fix(ingest/athena): Fix athena source if dbname is not specified in the connection string (#7417)

This commit is contained in:
Tamas Nemeth 2023-02-27 22:15:29 +01:00 committed by GitHub
parent cb7f1c6dc3
commit 77d072b522
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,7 +217,12 @@ class AthenaSource(SQLAlchemySource):
def get_database_container_key(self, db_name: str, schema: str) -> PlatformKey:
# Because our overridden get_allowed_schemas method returns db_name as the schema name,
# the db_name and schema here will be the same. Hence, we just ignore the schema parameter.
assert db_name == schema
# Based on community feedback, db_name only available if it is explicitly specified in the connection string.
# If it is not available then we should use schema as db_name
if not db_name:
db_name = schema
return gen_database_key(
db_name,
platform=self.platform,