Skip to content

Commit

Permalink
does not lowercase postgres and redshift database names (#990)
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfix authored Feb 22, 2024
1 parent b1d575f commit ffac99c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 0 additions & 3 deletions dlt/destinations/impl/postgres/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ def parse_native_representation(self, native_value: Any) -> None:
if not self.is_partial():
self.resolve()

def on_resolved(self) -> None:
self.database = self.database.lower()

def to_url(self) -> URL:
url = super().to_url()
url.update_query_pairs([("connect_timeout", str(self.connect_timeout))])
Expand Down
4 changes: 3 additions & 1 deletion tests/load/postgres/test_postgres_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ def test_postgres_credentials_defaults() -> None:
assert pg_cred.connect_timeout == 15
assert PostgresCredentials.__config_gen_annotations__ == ["port", "connect_timeout"]
# port should be optional
resolve_configuration(pg_cred, explicit_value="postgres://loader:loader@localhost/dlt_data")
resolve_configuration(pg_cred, explicit_value="postgres://loader:loader@localhost/DLT_DATA")
assert pg_cred.port == 5432
# preserve case
assert pg_cred.database == "DLT_DATA"


def test_postgres_credentials_native_value(environment) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/load/redshift/test_redshift_table_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_redshift_configuration() -> None:
}
):
C = resolve_configuration(RedshiftCredentials(), sections=("destination", "my_redshift"))
assert C.database == "upper_case_database"
assert C.database == "UPPER_CASE_DATABASE"
assert C.password == "pass"

# check fingerprint
Expand Down

0 comments on commit ffac99c

Please sign in to comment.