Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(tableau-multiple-upstreamDatabases): fixed wrong database attach to upstream tables #4447

Merged
merged 1 commit into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions metadata-ingestion/src/datahub/ingestion/source/tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,15 +242,14 @@ def _create_upstream_table_lineage(
self, datasource: dict, project: str, is_custom_sql: bool = False
) -> List[UpstreamClass]:
upstream_tables = []
upstream_dbs = datasource.get("upstreamDatabases", [])
upstream_db = upstream_dbs[0].get("name", "") if upstream_dbs else ""

for table in datasource.get("upstreamTables", []):
# skip upstream tables when there is no column info when retrieving embedded datasource
# Schema details for these will be taken care in self.emit_custom_sql_ds()
if not is_custom_sql and not table.get("columns"):
continue

upstream_db = table.get("database", {}).get("name", "")
schema = self._get_schema(table.get("schema", ""), upstream_db)
table_urn = make_table_urn(
self.config.env,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ class MetadataQueryException(Exception):
upstreamTables {
id
name
database {
name
}
schema
fullName
connectionType
Expand Down Expand Up @@ -214,6 +217,9 @@ class MetadataQueryException(Exception):
upstreamTables {
id
name
database {
name
}
schema
connectionType
}
Expand Down Expand Up @@ -255,6 +261,9 @@ class MetadataQueryException(Exception):
upstreamTables {
id
name
database {
name
}
schema
fullName
connectionType
Expand Down
Loading