fix(ingest/tableau): handle none database field (#11950)

This commit is contained in:
Harshal Sheth 2024-11-26 01:00:56 -05:00 committed by GitHub
parent 32ef389440
commit 9f9a8b1006
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -643,8 +643,11 @@ class TableauUpstreamReference:
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)