databricks-sql-python
databricks-sql-python copied to clipboard
cursor doesn't respond/raise exceptions when a query is cancelled in the backend
Hi Team, We have observed that the cursor doesn't respond/raise exceptions when a query is cancelled in the backend it just hangs (keeps on running) I don't see any solutions online. Any idea on how to handle this?
conn= connection(connection_params)
cursor = conn.cursor()
c = cursor.execute(query)
print(c)
print(c.query_id)
print("query executed")
query_id = cursor.query_id
print(f"In query: {query_id}")
result = cursor.fetchmany_arrow(100000)
if not result:
raise Exception("No results")
query_id = cursor.query_id
print(f"In query: {query_id}")