Skip to content

Commit c4bcfe3

Browse files
committed
does not lowercase postgres and redshift database names
1 parent eaf3c05 commit c4bcfe3

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

dlt/destinations/impl/postgres/configuration.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ def parse_native_representation(self, native_value: Any) -> None:
2525
if not self.is_partial():
2626
self.resolve()
2727

28-
def on_resolved(self) -> None:
29-
self.database = self.database.lower()
30-
3128
def to_url(self) -> URL:
3229
url = super().to_url()
3330
url.update_query_pairs([("connect_timeout", str(self.connect_timeout))])

tests/load/postgres/test_postgres_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ def test_postgres_credentials_defaults() -> None:
3737
assert pg_cred.connect_timeout == 15
3838
assert PostgresCredentials.__config_gen_annotations__ == ["port", "connect_timeout"]
3939
# port should be optional
40-
resolve_configuration(pg_cred, explicit_value="postgres://loader:loader@localhost/dlt_data")
40+
resolve_configuration(pg_cred, explicit_value="postgres://loader:loader@localhost/DLT_DATA")
4141
assert pg_cred.port == 5432
42+
# preserve case
43+
assert pg_cred.database == "DLT_DATA"
4244

4345

4446
def test_postgres_credentials_native_value(environment) -> None:

tests/load/redshift/test_redshift_table_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_redshift_configuration() -> None:
4242
}
4343
):
4444
C = resolve_configuration(RedshiftCredentials(), sections=("destination", "my_redshift"))
45-
assert C.database == "upper_case_database"
45+
assert C.database == "UPPER_CASE_DATABASE"
4646
assert C.password == "pass"
4747

4848
# check fingerprint

0 commit comments

Comments
 (0)