@@ -179,20 +179,14 @@ def test_cloud_fetch(self):
179
179
180
180
181
181
class TestPySQLAsyncQueriesSuite (PySQLPytestTestCase ):
182
- def isExecuting (self , operation_state ):
183
- return not operation_state or operation_state in [
184
- ttypes .TOperationState .RUNNING_STATE ,
185
- ttypes .TOperationState .PENDING_STATE ,
186
- ]
187
-
188
182
def test_execute_async__long_running (self ):
189
183
190
184
long_running_query = "SELECT COUNT(*) FROM RANGE(10000 * 16) x JOIN RANGE(10000) y ON FROM_UNIXTIME(x.id * y.id, 'yyyy-MM-dd') LIKE '%not%a%date%'"
191
185
with self .cursor () as cursor :
192
186
cursor .execute_async (long_running_query )
193
187
194
188
## Polling after every POLLING_INTERVAL seconds
195
- while self . isExecuting ( cursor .get_query_state () ):
189
+ while cursor .is_query_pending ( ):
196
190
time .sleep (self .POLLING_INTERVAL )
197
191
log .info ("Polling the status in test_execute_async" )
198
192
@@ -211,7 +205,7 @@ def test_execute_async__small_result(self):
211
205
time .sleep (5 )
212
206
213
207
## Polling after every POLLING_INTERVAL seconds
214
- while self . isExecuting ( cursor .get_query_state () ):
208
+ while cursor .is_query_pending ( ):
215
209
time .sleep (self .POLLING_INTERVAL )
216
210
log .info ("Polling the status in test_execute_async" )
217
211
@@ -241,7 +235,7 @@ def test_execute_async__large_result(self):
241
235
time .sleep (5 )
242
236
243
237
## Polling after every POLLING_INTERVAL seconds
244
- while self . isExecuting ( cursor .get_query_state () ):
238
+ while cursor .is_query_pending ( ):
245
239
time .sleep (self .POLLING_INTERVAL )
246
240
log .info ("Polling the status in test_execute_async" )
247
241
0 commit comments