From d3b75c70c7277c8ab389f06c45956ed4300d198c Mon Sep 17 00:00:00 2001
From: sagar-salvi-apptware <sagar.salvi@apptware.com>
Date: Mon, 23 Dec 2024 15:22:29 +0530
Subject: [PATCH 1/3] 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."
             )

From 2700b6477a9311d801acaa326fe27d5db279cec5 Mon Sep 17 00:00:00 2001
From: sagar-salvi-apptware
 <159135491+sagar-salvi-apptware@users.noreply.github.com>
Date: Mon, 23 Dec 2024 16:34:40 +0530
Subject: [PATCH 2/3] Update
 metadata-ingestion/src/datahub/sql_parsing/tool_meta_extractor.py

Co-authored-by: Mayuri Nehate <33225191+mayurinehate@users.noreply.github.com>
---
 .../src/datahub/sql_parsing/tool_meta_extractor.py              | 2 +-
 1 file changed, 1 insertion(+), 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 18ed095989bfc..767a00b9e2456 100644
--- a/metadata-ingestion/src/datahub/sql_parsing/tool_meta_extractor.py
+++ b/metadata-ingestion/src/datahub/sql_parsing/tool_meta_extractor.py
@@ -40,7 +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
+    looker_user_mapping_missing: Optional[bool] = None
 
 
 class ToolMetaExtractor:

From 6738c2f3465d57a30635348c43652b42270b27ec Mon Sep 17 00:00:00 2001
From: sagar-salvi-apptware
 <159135491+sagar-salvi-apptware@users.noreply.github.com>
Date: Mon, 23 Dec 2024 16:34:47 +0530
Subject: [PATCH 3/3] Update
 metadata-ingestion/src/datahub/sql_parsing/tool_meta_extractor.py

Co-authored-by: Mayuri Nehate <33225191+mayurinehate@users.noreply.github.com>
---
 .../src/datahub/sql_parsing/tool_meta_extractor.py              | 2 +-
 1 file changed, 1 insertion(+), 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 767a00b9e2456..d2682252e0fbf 100644
--- a/metadata-ingestion/src/datahub/sql_parsing/tool_meta_extractor.py
+++ b/metadata-ingestion/src/datahub/sql_parsing/tool_meta_extractor.py
@@ -110,7 +110,7 @@ def extract_looker_user_mapping_from_graph(
         )
 
         if len(platform_resources) == 0:
-            report.looker_mapping_missing = True
+            report.looker_user_mapping_missing = True
         elif len(platform_resources) > 1:
             report.failures.append(
                 "Looker user metadata extraction failed. Found more than one looker user id mappings."