From 77d072b5220394b574735b9af14948ef7f9c52ca Mon Sep 17 00:00:00 2001 From: Tamas Nemeth Date: Mon, 27 Feb 2023 22:15:29 +0100 Subject: [PATCH] fix(ingest/athena): Fix athena source if dbname is not specified in the connection string (#7417) --- .../src/datahub/ingestion/source/sql/athena.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/sql/athena.py b/metadata-ingestion/src/datahub/ingestion/source/sql/athena.py index 04e3ce9cab..4b03990341 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/sql/athena.py +++ b/metadata-ingestion/src/datahub/ingestion/source/sql/athena.py @@ -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,