Skip to content

Commit

Permalink
get query description
Browse files Browse the repository at this point in the history
Signed-off-by: Prithvi Kannan <[email protected]>
  • Loading branch information
prithvikannan committed Oct 30, 2024
1 parent 2bd27eb commit 63dd12d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/databricks_ai_bridge/genie.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit 63dd12d

Please sign in to comment.