From 9c2a30c3a1fed488c07cf1f822c5e927aa30cf8d Mon Sep 17 00:00:00 2001 From: Harshal Sheth Date: Wed, 14 Apr 2021 15:04:13 -0700 Subject: [PATCH] fix(ingest): add db name to postgres URNs (#2401) --- metadata-ingestion/src/datahub/ingestion/source/postgres.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/metadata-ingestion/src/datahub/ingestion/source/postgres.py b/metadata-ingestion/src/datahub/ingestion/source/postgres.py index d2d0691f1e..7dc9a280de 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/postgres.py +++ b/metadata-ingestion/src/datahub/ingestion/source/postgres.py @@ -15,6 +15,12 @@ class PostgresConfig(BasicSQLAlchemyConfig): # defaults scheme = "postgresql+psycopg2" + def get_identifier(self, schema: str, table: str) -> str: + regular = f"{schema}.{table}" + if self.database: + return f"{self.database}.{regular}" + return regular + class PostgresSource(SQLAlchemySource): def __init__(self, config, ctx):