88 ColumnInfo ,
99 ColumnInfoTypeName ,
1010 EndpointInfo ,
11- ExecuteStatementResponse ,
1211 ExternalLink ,
1312 Format ,
14- GetStatementResponse ,
1513 ResultData ,
1614 ResultManifest ,
1715 ResultSchema ,
1816 ServiceError ,
1917 ServiceErrorCode ,
2018 State ,
19+ StatementResponse ,
2120 StatementState ,
2221 StatementStatus ,
2322 timedelta ,
@@ -67,7 +66,7 @@ def test_row_factory_with_generator():
6766def test_selects_warehouse_from_config ():
6867 ws = create_autospec (WorkspaceClient )
6968 ws .config .warehouse_id = "abc"
70- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
69+ ws .statement_execution .execute_statement .return_value = StatementResponse (
7170 status = StatementStatus (state = StatementState .SUCCEEDED ),
7271 statement_id = "bcd" ,
7372 )
@@ -96,7 +95,7 @@ def test_selects_warehouse_from_existing_first_running():
9695 EndpointInfo (id = "cde" , state = State .RUNNING ),
9796 ]
9897
99- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
98+ ws .statement_execution .execute_statement .return_value = StatementResponse (
10099 status = StatementStatus (state = StatementState .SUCCEEDED ),
101100 )
102101
@@ -125,7 +124,7 @@ def test_selects_warehouse_from_existing_not_running():
125124 EndpointInfo (id = "cde" , state = State .STARTING ),
126125 ]
127126
128- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
127+ ws .statement_execution .execute_statement .return_value = StatementResponse (
129128 status = StatementStatus (state = StatementState .SUCCEEDED ),
130129 )
131130
@@ -155,11 +154,11 @@ def test_no_warehouse_given():
155154
156155def test_execute_poll_succeeds ():
157156 ws = create_autospec (WorkspaceClient )
158- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
157+ ws .statement_execution .execute_statement .return_value = StatementResponse (
159158 status = StatementStatus (state = StatementState .PENDING ),
160159 statement_id = "bcd" ,
161160 )
162- ws .statement_execution .get_statement .return_value = GetStatementResponse (
161+ ws .statement_execution .get_statement .return_value = StatementResponse (
163162 manifest = ResultManifest (),
164163 result = ResultData (byte_count = 100500 ),
165164 statement_id = "bcd" ,
@@ -202,7 +201,7 @@ def test_execute_poll_succeeds():
202201def test_execute_fails (status_error , platform_error_type ):
203202 ws = create_autospec (WorkspaceClient )
204203
205- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
204+ ws .statement_execution .execute_statement .return_value = StatementResponse (
206205 status = StatementStatus (state = StatementState .FAILED , error = status_error ),
207206 statement_id = "bcd" ,
208207 )
@@ -216,14 +215,14 @@ def test_execute_fails(status_error, platform_error_type):
216215def test_execute_poll_waits ():
217216 ws = create_autospec (WorkspaceClient )
218217
219- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
218+ ws .statement_execution .execute_statement .return_value = StatementResponse (
220219 status = StatementStatus (state = StatementState .PENDING ),
221220 statement_id = "bcd" ,
222221 )
223222
224223 ws .statement_execution .get_statement .side_effect = [
225- GetStatementResponse (status = StatementStatus (state = StatementState .RUNNING ), statement_id = "bcd" ),
226- GetStatementResponse (
224+ StatementResponse (status = StatementStatus (state = StatementState .RUNNING ), statement_id = "bcd" ),
225+ StatementResponse (
227226 manifest = ResultManifest (),
228227 result = ResultData (byte_count = 100500 ),
229228 statement_id = "bcd" ,
@@ -242,12 +241,12 @@ def test_execute_poll_waits():
242241def test_execute_poll_timeouts_on_client ():
243242 ws = create_autospec (WorkspaceClient )
244243
245- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
244+ ws .statement_execution .execute_statement .return_value = StatementResponse (
246245 status = StatementStatus (state = StatementState .PENDING ),
247246 statement_id = "bcd" ,
248247 )
249248
250- ws .statement_execution .get_statement .return_value = GetStatementResponse (
249+ ws .statement_execution .get_statement .return_value = StatementResponse (
251250 status = StatementStatus (state = StatementState .RUNNING ),
252251 statement_id = "bcd" ,
253252 )
@@ -262,7 +261,7 @@ def test_execute_poll_timeouts_on_client():
262261def test_fetch_all_no_chunks ():
263262 ws = create_autospec (WorkspaceClient )
264263
265- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
264+ ws .statement_execution .execute_statement .return_value = StatementResponse (
266265 status = StatementStatus (state = StatementState .SUCCEEDED ),
267266 manifest = ResultManifest (
268267 schema = ResultSchema (
@@ -298,7 +297,7 @@ def test_fetch_all_no_chunks():
298297def test_fetch_all_no_chunks_no_converter ():
299298 ws = create_autospec (WorkspaceClient )
300299
301- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
300+ ws .statement_execution .execute_statement .return_value = StatementResponse (
302301 status = StatementStatus (state = StatementState .SUCCEEDED ),
303302 manifest = ResultManifest (
304303 schema = ResultSchema (
@@ -323,7 +322,7 @@ def test_fetch_all_no_chunks_no_converter():
323322def test_fetch_all_two_chunks ():
324323 ws = create_autospec (WorkspaceClient )
325324
326- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
325+ ws .statement_execution .execute_statement .return_value = StatementResponse (
327326 status = StatementStatus (state = StatementState .SUCCEEDED ),
328327 manifest = ResultManifest (
329328 schema = ResultSchema (
@@ -361,7 +360,7 @@ def test_fetch_all_two_chunks():
361360def test_fetch_one ():
362361 ws = create_autospec (WorkspaceClient )
363362
364- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
363+ ws .statement_execution .execute_statement .return_value = StatementResponse (
365364 status = StatementStatus (state = StatementState .SUCCEEDED ),
366365 manifest = ResultManifest (schema = ResultSchema (columns = [ColumnInfo (name = "id" , type_name = ColumnInfoTypeName .INT )])),
367366 result = ResultData (data_array = [["4" ]]),
@@ -389,7 +388,7 @@ def test_fetch_one():
389388def test_fetch_one_none ():
390389 ws = create_autospec (WorkspaceClient )
391390
392- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
391+ ws .statement_execution .execute_statement .return_value = StatementResponse (
393392 status = StatementStatus (state = StatementState .SUCCEEDED ),
394393 manifest = ResultManifest (schema = ResultSchema (columns = [ColumnInfo (name = "id" , type_name = ColumnInfoTypeName .INT )])),
395394 statement_id = "bcd" ,
@@ -405,7 +404,7 @@ def test_fetch_one_none():
405404def test_fetch_one_disable_magic ():
406405 ws = create_autospec (WorkspaceClient )
407406
408- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
407+ ws .statement_execution .execute_statement .return_value = StatementResponse (
409408 status = StatementStatus (state = StatementState .SUCCEEDED ),
410409 manifest = ResultManifest (schema = ResultSchema (columns = [ColumnInfo (name = "id" , type_name = ColumnInfoTypeName .INT )])),
411410 result = ResultData (data_array = [["4" ], ["5" ], ["6" ]]),
@@ -433,7 +432,7 @@ def test_fetch_one_disable_magic():
433432def test_fetch_value ():
434433 ws = create_autospec (WorkspaceClient )
435434
436- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
435+ ws .statement_execution .execute_statement .return_value = StatementResponse (
437436 status = StatementStatus (state = StatementState .SUCCEEDED ),
438437 manifest = ResultManifest (schema = ResultSchema (columns = [ColumnInfo (name = "id" , type_name = ColumnInfoTypeName .INT )])),
439438 result = ResultData (data_array = [["4" ]]),
@@ -450,7 +449,7 @@ def test_fetch_value():
450449def test_fetch_value_none ():
451450 ws = create_autospec (WorkspaceClient )
452451
453- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
452+ ws .statement_execution .execute_statement .return_value = StatementResponse (
454453 status = StatementStatus (state = StatementState .SUCCEEDED ),
455454 manifest = ResultManifest (schema = ResultSchema (columns = [ColumnInfo (name = "id" , type_name = ColumnInfoTypeName .INT )])),
456455 statement_id = "bcd" ,
@@ -466,7 +465,7 @@ def test_fetch_value_none():
466465def test_callable_returns_iterator ():
467466 ws = create_autospec (WorkspaceClient )
468467
469- ws .statement_execution .execute_statement .return_value = ExecuteStatementResponse (
468+ ws .statement_execution .execute_statement .return_value = StatementResponse (
470469 status = StatementStatus (state = StatementState .SUCCEEDED ),
471470 manifest = ResultManifest (schema = ResultSchema (columns = [ColumnInfo (name = "id" , type_name = ColumnInfoTypeName .INT )])),
472471 result = ResultData (data_array = [["4" ], ["5" ], ["6" ]]),
0 commit comments