Skip to content

Commit

Permalink
removes sql alchemy dependency and port parts of URL class
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfix committed Feb 28, 2024
1 parent 5a46b09 commit 71b6180
Show file tree
Hide file tree
Showing 12 changed files with 458 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from typing import Any, ClassVar, Dict, List, Optional
from sqlalchemy.engine import URL, make_url
from dlt.common.libs.sql_alchemy import URL, make_url
from dlt.common.configuration.specs.exceptions import InvalidConnectionString

from dlt.common.typing import TSecretValue
Expand All @@ -26,7 +26,7 @@ def parse_native_representation(self, native_value: Any) -> None:
# update only values that are not None
self.update({k: v for k, v in url._asdict().items() if v is not None})
if self.query is not None:
self.query = dict(self.query)
self.query = self.query.copy()
except Exception:
raise InvalidConnectionString(self.__class__, native_value, self.drivername)

Expand Down
1 change: 1 addition & 0 deletions dlt/common/configuration/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def serialize_value(value: Any) -> Any:
return str(value)
if isinstance(value, BaseConfiguration):
try:
print("TO NATIVE")
return value.to_native_representation()
except NotImplementedError:
# no native representation: use dict
Expand Down
Loading

0 comments on commit 71b6180

Please sign in to comment.