From 3dba82d6c13e0b675250ec6f7f9de5550b084742 Mon Sep 17 00:00:00 2001 From: Parul Gupta Date: Wed, 15 Jan 2025 12:53:34 -0800 Subject: [PATCH 1/2] [Typing] Fix typing of MySQLConnectionAbstract close function --- mysql-connector-python/lib/mysql/connector/abstracts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-connector-python/lib/mysql/connector/abstracts.py b/mysql-connector-python/lib/mysql/connector/abstracts.py index 442a81aa..3a20478e 100644 --- a/mysql-connector-python/lib/mysql/connector/abstracts.py +++ b/mysql-connector-python/lib/mysql/connector/abstracts.py @@ -1398,7 +1398,7 @@ def disconnect(self) -> None: use `shutdown()`. """ - close: Callable[[], Any] = disconnect + close: Callable[["MySQLConnectionAbstract"], Any] = disconnect def connect(self, **kwargs: Any) -> None: """Connects to the MySQL server. From 96a3e6976367d5aff4c82b529648d62c8fb1d8dc Mon Sep 17 00:00:00 2001 From: Parul Gupta Date: Tue, 21 Jan 2025 08:47:10 -0800 Subject: [PATCH 2/2] Fix type for return type of disconnect in connector --- mysql-connector-python/lib/mysql/connector/abstracts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-connector-python/lib/mysql/connector/abstracts.py b/mysql-connector-python/lib/mysql/connector/abstracts.py index ed4ff92b..1d283084 100644 --- a/mysql-connector-python/lib/mysql/connector/abstracts.py +++ b/mysql-connector-python/lib/mysql/connector/abstracts.py @@ -1501,7 +1501,7 @@ def disconnect(self) -> None: use `shutdown()`. """ - close: Callable[["MySQLConnectionAbstract"], Any] = disconnect + close: Callable[["MySQLConnectionAbstract"], None] = disconnect def connect(self, **kwargs: Any) -> None: """Connects to the MySQL server.