@@ -179,20 +179,14 @@ def test_cloud_fetch(self):
179179
180180
181181class 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-
188182 def test_execute_async__long_running (self ):
189183
190184 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%'"
191185 with self .cursor () as cursor :
192186 cursor .execute_async (long_running_query )
193187
194188 ## Polling after every POLLING_INTERVAL seconds
195- while self . isExecuting ( cursor .get_query_state () ):
189+ while cursor .is_query_pending ( ):
196190 time .sleep (self .POLLING_INTERVAL )
197191 log .info ("Polling the status in test_execute_async" )
198192
@@ -211,7 +205,7 @@ def test_execute_async__small_result(self):
211205 time .sleep (5 )
212206
213207 ## Polling after every POLLING_INTERVAL seconds
214- while self . isExecuting ( cursor .get_query_state () ):
208+ while cursor .is_query_pending ( ):
215209 time .sleep (self .POLLING_INTERVAL )
216210 log .info ("Polling the status in test_execute_async" )
217211
@@ -241,7 +235,7 @@ def test_execute_async__large_result(self):
241235 time .sleep (5 )
242236
243237 ## Polling after every POLLING_INTERVAL seconds
244- while self . isExecuting ( cursor .get_query_state () ):
238+ while cursor .is_query_pending ( ):
245239 time .sleep (self .POLLING_INTERVAL )
246240 log .info ("Polling the status in test_execute_async" )
247241
0 commit comments