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): fixes missed lineage #12434

Merged
merged 19 commits into from
Jan 30, 2025
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
26 changes: 14 additions & 12 deletions metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -2428,10 +2428,12 @@
]
],
) -> Optional["SqlParsingResult"]:
database_info = datasource.get(c.DATABASE) or {
c.NAME: c.UNKNOWN.lower(),
c.CONNECTION_TYPE: datasource.get(c.CONNECTION_TYPE),
}
database_field = datasource.get(c.DATABASE) or {}
database_id: Optional[str] = database_field.get(c.ID)
database_name: Optional[str] = database_field.get(c.NAME) or c.UNKNOWN.lower()
database_connection_type: Optional[str] = database_field.get(

Check warning on line 2434 in metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py

View check run for this annotation

Codecov / codecov/patch

metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py#L2431-L2434

Added lines #L2431 - L2434 were not covered by tests
c.CONNECTION_TYPE
) or datasource.get(c.CONNECTION_TYPE)

if (
datasource.get(c.IS_UNSUPPORTED_CUSTOM_SQL) in (None, False)
Expand All @@ -2440,10 +2442,7 @@
logger.debug(f"datasource {datasource_urn} is not created from custom sql")
return None

if (
database_info.get(c.NAME) is None
or database_info.get(c.CONNECTION_TYPE) is None
):
if database_connection_type is None:

Check warning on line 2445 in metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py

View check run for this annotation

Codecov / codecov/patch

metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py#L2445

Added line #L2445 was not covered by tests
logger.debug(
f"database information is missing from datasource {datasource_urn}"
)
Expand All @@ -2459,14 +2458,14 @@

logger.debug(f"Parsing sql={query}")

upstream_db = database_info.get(c.NAME)
upstream_db = database_name

Check warning on line 2461 in metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py

View check run for this annotation

Codecov / codecov/patch

metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py#L2461

Added line #L2461 was not covered by tests

if func_overridden_info is not None:
# Override the information as per configuration
upstream_db, platform_instance, platform, _ = func_overridden_info(
database_info[c.CONNECTION_TYPE],
database_info.get(c.NAME),
database_info.get(c.ID),
database_connection_type,
database_name,
database_id,
self.config.platform_instance_map,
self.config.lineage_overrides,
self.config.database_hostname_to_platform_instance_map,
Expand Down Expand Up @@ -2534,6 +2533,9 @@
platform_instance=self.config.platform_instance,
func_overridden_info=get_overridden_info,
)
logger.debug(

Check warning on line 2536 in metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py

View check run for this annotation

Codecov / codecov/patch

metadata-ingestion/src/datahub/ingestion/source/tableau/tableau.py#L2536

Added line #L2536 was not covered by tests
f"_create_lineage_from_unsupported_csql parsed_result = {parsed_result}"
)

if parsed_result is None:
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ def make_dataset_urn(


def get_overridden_info(
connection_type: Optional[str],
connection_type: str,
upstream_db: Optional[str],
upstream_db_id: Optional[str],
platform_instance_map: Optional[Dict[str, str]],
Expand Down
Loading