From d3b75c70c7277c8ab389f06c45956ed4300d198c Mon Sep 17 00:00:00 2001 From: sagar-salvi-apptware Date: Mon, 23 Dec 2024 15:22:29 +0530 Subject: [PATCH] fix(ingest/looker): Add flag for Looker metadata extraction --- .../src/datahub/sql_parsing/tool_meta_extractor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/metadata-ingestion/src/datahub/sql_parsing/tool_meta_extractor.py b/metadata-ingestion/src/datahub/sql_parsing/tool_meta_extractor.py index 5af9d9d4f0fff..18ed095989bfc 100644 --- a/metadata-ingestion/src/datahub/sql_parsing/tool_meta_extractor.py +++ b/metadata-ingestion/src/datahub/sql_parsing/tool_meta_extractor.py @@ -40,6 +40,7 @@ def _get_last_line(query: str) -> str: class ToolMetaExtractorReport(Report): num_queries_meta_extracted: Dict[str, int] = field(default_factory=int_top_k_dict) failures: List[str] = field(default_factory=list) + looker_mapping_missing = False class ToolMetaExtractor: @@ -108,7 +109,9 @@ def extract_looker_user_mapping_from_graph( PlatformResource.search_by_filters(query=query, graph_client=graph) ) - if len(platform_resources) > 1: + if len(platform_resources) == 0: + report.looker_mapping_missing = True + elif len(platform_resources) > 1: report.failures.append( "Looker user metadata extraction failed. Found more than one looker user id mappings." )