diff --git a/google/cloud/sql/connector/connector.py b/google/cloud/sql/connector/connector.py index 28b42587..132f385a 100755 --- a/google/cloud/sql/connector/connector.py +++ b/google/cloud/sql/connector/connector.py @@ -88,7 +88,7 @@ def __init__( enable_iam_auth: bool = False, timeout: int = 30, credentials: Optional[Credentials] = None, - loop: asyncio.AbstractEventLoop = None, + loop: Optional[asyncio.AbstractEventLoop] = None, quota_project: Optional[str] = None, sqladmin_api_endpoint: str = "https://sqladmin.googleapis.com", ) -> None: @@ -333,7 +333,7 @@ async def create_async_connector( enable_iam_auth: bool = False, timeout: int = 30, credentials: Optional[Credentials] = None, - loop: asyncio.AbstractEventLoop = None, + loop: Optional[asyncio.AbstractEventLoop] = None, ) -> Connector: """ Create Connector object for asyncio connections that can auto-detect diff --git a/google/cloud/sql/connector/instance.py b/google/cloud/sql/connector/instance.py index 8f6ba603..cb693987 100644 --- a/google/cloud/sql/connector/instance.py +++ b/google/cloud/sql/connector/instance.py @@ -222,7 +222,7 @@ def __init__( loop: asyncio.AbstractEventLoop, credentials: Optional[Credentials] = None, enable_iam_auth: bool = False, - quota_project: str = None, + quota_project: Optional[str] = None, sqladmin_api_endpoint: str = "https://sqladmin.googleapis.com", ) -> None: # validate and parse instance connection name diff --git a/google/cloud/sql/connector/rate_limiter.py b/google/cloud/sql/connector/rate_limiter.py index 21a3ff74..6698471d 100644 --- a/google/cloud/sql/connector/rate_limiter.py +++ b/google/cloud/sql/connector/rate_limiter.py @@ -14,6 +14,7 @@ limitations under the License. """ import asyncio +from typing import Optional class AsyncRateLimiter(object): @@ -41,7 +42,7 @@ def __init__( self, max_capacity: int = 1, rate: float = 1 / 60, - loop: asyncio.AbstractEventLoop = None, + loop: Optional[asyncio.AbstractEventLoop] = None, ) -> None: self.rate = rate self.max_capacity = max_capacity diff --git a/noxfile.py b/noxfile.py index 6b3f55b4..a4beddac 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,7 +23,6 @@ BLACK_VERSION = "black==23.12.1" ISORT_VERSION = "isort==5.13.2" -MYPY_VERSION = "mypy==0.982" LINT_PATHS = ["google", "tests", "noxfile.py", "setup.py"] @@ -40,7 +39,7 @@ def lint(session): session.install( "flake8", "flake8-annotations", - MYPY_VERSION, + "mypy", BLACK_VERSION, ISORT_VERSION, "types-setuptools",