Skip to content

Commit

Permalink
fix(ingest/tableau): handle none database field (datahub-project#11950)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored Nov 26, 2024
1 parent 32ef389 commit 9f9a8b1
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,11 @@ def create(
cls, d: dict, default_schema_map: Optional[Dict[str, str]] = None
) -> "TableauUpstreamReference":
# Values directly from `table` object from Tableau
database = t_database = d.get(c.DATABASE, {}).get(c.NAME)
database_id = d.get(c.DATABASE, {}).get(c.ID)
database_dict = (
d.get(c.DATABASE) or {}
) # this sometimes is None, so we need the `or {}`
database = t_database = database_dict.get(c.NAME)
database_id = database_dict.get(c.ID)
schema = t_schema = d.get(c.SCHEMA)
table = t_table = d.get(c.NAME) or ""
t_full_name = d.get(c.FULL_NAME)
Expand Down

0 comments on commit 9f9a8b1

Please sign in to comment.