Skip to content

Commit 8d30436

Browse files
jprakash-dbvarun-edachali-dbx
authored andcommitted
Added example for async execute query (#537)
Added examples and fixed the async execute not working without pyarrow Signed-off-by: varun-edachali-dbx <[email protected]>
1 parent dd083f6 commit 8d30436

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/databricks/sql/client.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,19 @@ def is_query_pending(self):
876876
ttypes.TOperationState.PENDING_STATE,
877877
]
878878

879+
def is_query_pending(self):
880+
"""
881+
Checks whether the async executing query is in pending state or not
882+
883+
:return:
884+
"""
885+
operation_state = self.get_query_state()
886+
887+
return not operation_state or operation_state in [
888+
ttypes.TOperationState.RUNNING_STATE,
889+
ttypes.TOperationState.PENDING_STATE,
890+
]
891+
879892
def get_async_execution_result(self):
880893
"""
881894

0 commit comments

Comments
 (0)