From b9b317ada57ca4b58dc2a171575f8b1179b9bbcc Mon Sep 17 00:00:00 2001 From: Steinthor Palsson Date: Fri, 6 Sep 2024 15:00:56 -0400 Subject: [PATCH] Lint, no cli tests --- .github/workflows/test_sqlalchemy_destinations.yml | 2 +- dlt/destinations/impl/sqlalchemy/configuration.py | 7 ++++++- tests/cases.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_sqlalchemy_destinations.yml b/.github/workflows/test_sqlalchemy_destinations.yml index 9186e5f8cd..245060e811 100644 --- a/.github/workflows/test_sqlalchemy_destinations.yml +++ b/.github/workflows/test_sqlalchemy_destinations.yml @@ -92,7 +92,7 @@ jobs: run: pwd && echo "$DLT_SECRETS_TOML" > tests/.dlt/secrets.toml # always run full suite, also on branches - - run: poetry run pytest tests/load tests/cli -x + - run: poetry run pytest tests/load -x name: Run tests Linux env: DESTINATION__SQLALCHEMY_MYSQL__CREDENTIALS: mysql://root:root@127.0.0.1:3306/dlt_data # Use root cause we need to create databases diff --git a/dlt/destinations/impl/sqlalchemy/configuration.py b/dlt/destinations/impl/sqlalchemy/configuration.py index bdbece0310..f99b06a27b 100644 --- a/dlt/destinations/impl/sqlalchemy/configuration.py +++ b/dlt/destinations/impl/sqlalchemy/configuration.py @@ -1,4 +1,4 @@ -from typing import TYPE_CHECKING, Optional, Any, Final, Type, Dict +from typing import TYPE_CHECKING, Optional, Any, Final, Type, Dict, Union import dataclasses from dlt.common.configuration import configspec @@ -16,6 +16,11 @@ class SqlalchemyCredentials(ConnectionStringCredentials): username: Optional[str] = None # e.g. sqlite doesn't need username + def __init__( + self, connection_string: Optional[Union[str, Dict[str, Any], "Engine"]] = None + ) -> None: + super().__init__(connection_string) # type: ignore[arg-type] + def parse_native_representation(self, native_value: Any) -> None: from sqlalchemy.engine import Engine diff --git a/tests/cases.py b/tests/cases.py index 121d4af6e5..41482e5c6f 100644 --- a/tests/cases.py +++ b/tests/cases.py @@ -1,4 +1,4 @@ -import datetime +import datetime # noqa: I251 import hashlib from typing import Dict, List, Any, Sequence, Tuple, Literal, Union import base64