From 63dd12d5378406e7e958c3372a38b0dc4dc6bbf8 Mon Sep 17 00:00:00 2001 From: Prithvi Kannan Date: Tue, 29 Oct 2024 21:18:11 -0700 Subject: [PATCH] get query description Signed-off-by: Prithvi Kannan --- src/databricks_ai_bridge/genie.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/databricks_ai_bridge/genie.py b/src/databricks_ai_bridge/genie.py index 66ab1dc..fe41cfd 100644 --- a/src/databricks_ai_bridge/genie.py +++ b/src/databricks_ai_bridge/genie.py @@ -108,7 +108,10 @@ def poll_result(): headers=self.headers, ) if resp["status"] == "EXECUTING_QUERY": - sql = next(r for r in resp["attachments"] if "query" in r)["query"]["query"] + query = next(r for r in resp["attachments"] if "query" in r)["query"] + description = query["description"] + sql = query["query"] + logging.debug(f"Description: {description}") logging.debug(f"SQL: {sql}") return poll_query_results() elif resp["status"] == "COMPLETED":