Skip to content

Commit

Permalink
add failed state
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 63dd12d commit 035effe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/databricks_ai_bridge/genie.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ def poll_result():
return poll_query_results()
elif resp["status"] == "COMPLETED":
return next(r for r in resp["attachments"] if "text" in r)["text"]["content"]
elif resp["status"] == "FAILED":
logging.debug("Genie failed to execute the query")
return None
else:
logging.debug(f"Waiting...: {resp['status']}")
time.sleep(5)
Expand Down

0 comments on commit 035effe

Please sign in to comment.