Commit 3a58b3a
fix: Several changes were missed when Async queries add cancel status was first merged (#199)
* Added async_execution to async_db/cursor and db/cursor. Added an error, . Added a slot and getter for query_id to BaseCursor. (Temporarily?) edited setup.cfg to ignore flake8 C901: function is too complex.
* Removed ignore C901 from flake8 settings in setup.cfg.
* Fixed a couple of missing arguments in async_db/cursor.py on execute and execute_many calls.
* mypy and black cleanup.
* Removed set_parameters argument from all(?) functions. Started adding logic for SET async_execution.
* Added a bunch of callbacks to cursor tests.
* Pulled out a couple more set_parameters variables from function signatures. Edited callbacks and various tiny things in async test_cursor.py.
* Added, and commented out, server_side_async_url to unit/conftests.py.
* Removed test_set_parameters() from tests/async/cursor.py.
* Removed test_set_parameters() from tests/async/cursor.py.
* Added ability to see which exectute is failing (execute or executemany) on a unit test run.
* Added more explicit error messages to async and sync test_cursor.py modules.
* Added some periods.
* Replaced cursor reset call in async _do_execute().
* Updated query/message tuple decomposition in test_cursor to be more human-readable.
* Fixed a typo and function signature for db/test_cursor_server_side_async_execute() to remove async.
* Removed second hard-coding of query_id in server-side async id callback.
* Needed to add an await to an _api_request() call.
* Used InternalError to error out on no response to async server-side query. Changed AsyncExecutionUnavailableError to generically accept messages.
* Added additional checks on rowcount and description in test_cursor_server_side_async_execute().
* Added QueryResponse class.
* Minor changes requested on PR.
* Added an OperationalError is asynchronous query response is missing query_id.
* Had a typo.
* Added a warning if asyc_execution is set via a SET parameter rather than being sent in as an argument to execute(). Moved set parameter validation to its own function to deal with flake8 complaints re _do_exectute() being too complex.
* Started adding test_cursor_async_execute_error().
* Updated query_url argument in test_cursor_async_execute_error().
* Added AsyncExecutionUnavailableError on server-side async query execution for multi-statement queries.
* Seem to have dealt with auth issues in test_cursor_async_execute_error, but getting invalid set parameter on use_standard_sql. Also added # noqa: C901 to parse_type() definition in _types.py because flake8 was suddenly freaking out about it.
* Added all necessary set params to url string in test_cursor_async_execute_error().
* Cleaned up string input in test_cursor_async_execute_error().
* Now no token error.
* Multi-statement queries now error out correctly.
* Reworked a string to try to get commit/push to work.
* Had to add an extra auth callback to get all cursor.execute() calls to work. All error tests for async_execution should now be tested correctly.
* Removed some parameters from various fns in unit/async_db/test_cursor that I noticed were extraneous. Too bad mypy or flake8 isn't catching these :-/.
* Added error check for missing query_id on async_execution. A little bit of cleanup, also Black seems to have made a change or two.
* Fixed error for empty response.json on asynch execution. Also changed the use of SET async_execution to an error and included test for that error.
* Fixed error for empty response.json on asynch execution. Also changed the use of SET async_execution to an error and included test for that error.
* Fixed error for empty response.json on asynch execution. Also changed the use of SET async_execution to an error and included test for that error.
* Added a test to check that an server-side asynchronous execution returns a string, as a non-sync-execution query would return rowcount as an int.
* Added an integration test to check that an server-side asynchronous execution returns a string, as a non-sync-execution query would return rowcount as an int.~
* Added cancel() to async/cursor.py. Also fixed an error where I was getting empty query ids back from server-side async exectutions, and added an error for that case.
* Forgot that I'd commented out most of test_cursor.py.
* Trying to get rid of coroutine 'BaseCursor.execute' was never awaited warning. Not yet successful.
* Added unit tests for cancel and cancel errors.
* Fixed a mistake that would have failed the cancel() integration test.
* Fixed several imports that had disappeared (maybe during a merge?). Also fixed an error in test_ss_async_execution_cancel().
* get_status() and two unit tests are added. Integration test is failing with json that has correct field names but empty fields.
* Added a new QueryStatus, NOT_AVAILABLE, because checking status will return empty result the first few times. Fixed some issues with the unit tests and updated the integration tests for get_status().
* Added a comment.
* Updated a comment.
* Added stub fn for async execution fetch.
* Keep forgetting to uncomment test code and the pre-commit checks are removing imports. Left in some extra calls to time() and sleep() for now.
* Removed some extraneous testing code.
* Updated test_ss_async_execution_get_status() after Yoni pointed out that DDL operations will always return empty JSON. Now using an INSERT instead.
* Had to comment out test_ss_async_execution_get_status(), as it basically entered an infinite loop.
* Added ability to specify output_format in _api_request(), as status requests will fail if it is set.
* First set of requested changes on PR.
* Removed noqa on _do_execute().
* Renamed _find_async_problems() to _validate_ss_async_settings(). Removed test_cursor_server_side_async_cancel_error from integration tests.
* Moved call to _validate_ss_async_settings() into try.
* Added asyncio_mode=auto to pytest config in config.cfg, because I was tired of the continual warnings from pytest.
* Changed long query in test_queries_async integration tests. Paused execution of after cancel() to ensure I pick up the correct status message. Now sending output_format= on some calls to _api_request().
* Updated all unit tests that test SET parameters to not have output_format in the url.
* Changed query_loop() in integration tests/async/test_queries to check for more than one status before exiting the loop.
* Noticed that test_anyio_backend_import_issue() was commented out in sync/test_queries.py. That was done bc it won't run on my laptop, but it shouldn't have been committed that way.
* Added query tests to integration/dbapi/sync/test_queries.py. Changed async_exectution test to not count SET statements as queries when determining whether a query is multi-statment. Trying to get sleepEachRow() to work for long aync execution queries.
* Added query tests to integration/dbapi/sync/test_queries.py. Changed async_execution test to not count SET statements as queries when determining whether a query is multi-statment. Trying to get sleepEachRow() to work for long aync execution queries.
* Now errors out when use_standard_sql=0 rather than when it equals 1. This is because if it's off no log entries are written to query_history. Still using a long insert for integration tests on server-side async queries. Added and edited to unit tests for use_standard_sql correctness.
* Changed order of synchronous unit tests to move all server-side async tests to end.
* Changed order of asynchronous cursor unit tests to move all server-side async tests to end.
* Reordered integration and unit test modules to move all server-side async tests to end of modules to facilitate merging main.
* Moving JSON_OUTPUT_FORMAT outside of _api_request (#196)
* Updated docs to include information on server-side async query execution.
* Updated external table mention in comments and removed sentence in docs. Updated dictionary update in _api_request() to make mypy happy.
* Made a change to server-side execution explanation for clarity and to explain usefullness of that functionality.
* Renamed a function and moved table create and drop out of test_queries.py and into conftest.py. Currently name not defined error. Maybe it's in the wrong conftest file?
* Damn. I merged and there were uncommitted changes.
* Removed two typos in docsrc/connecting_and_queries.rst.
* Updated the description of both server-side and client-side async in the docs to clarify the differences.
* Created setup and teardown fixture for creating and dropping test_tbl in integration tests.
* Damn. I merged the PR to main and there were uncommitted changes.
* Removed two typos in docsrc/connecting_and_queries.rst.
* Updated the description of both server-side and client-side async in the docs to clarify the differences.
* Created setup and teardown fixture for creating and dropping test_tbl in integration tests.
* Typo.
* Trying to get a long enough query. Now I'm getting parse errors that I can't figure out.
* Just skipping integration tests on cancel and get_status().
* Cleaned up two long strings and commented out assert in integration test db/sync/test_queries::test_server_side_async_execution_get_status.
Co-authored-by: Petro Tiurin <[email protected]>1 parent 3b4db72 commit 3a58b3a
File tree
4 files changed
+87
-78
lines changed- src/firebolt/async_db
- tests/integration/dbapi
- async
- sync
4 files changed
+87
-78
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
664 | 664 | | |
665 | 665 | | |
666 | 666 | | |
| 667 | + | |
667 | 668 | | |
668 | 669 | | |
669 | 670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 11 | + | |
| 12 | + | |
15 | 13 | | |
16 | | - | |
| 14 | + | |
17 | 15 | | |
18 | 16 | | |
19 | 17 | | |
| |||
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
| |||
427 | 431 | | |
428 | 432 | | |
429 | 433 | | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
430 | 437 | | |
431 | | - | |
| 438 | + | |
432 | 439 | | |
433 | 440 | | |
434 | | - | |
435 | | - | |
436 | | - | |
437 | | - | |
438 | | - | |
| 441 | + | |
| 442 | + | |
439 | 443 | | |
440 | 444 | | |
441 | 445 | | |
442 | 446 | | |
443 | 447 | | |
444 | 448 | | |
| 449 | + | |
445 | 450 | | |
446 | 451 | | |
447 | 452 | | |
448 | 453 | | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
449 | 461 | | |
450 | | - | |
| 462 | + | |
451 | 463 | | |
452 | 464 | | |
453 | | - | |
454 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
455 | 468 | | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
478 | | - | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | 14 | | |
17 | 15 | | |
18 | 16 | | |
19 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
20 | 36 | | |
21 | 37 | | |
22 | 38 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 21 | | |
26 | 22 | | |
27 | 23 | | |
| |||
39 | 35 | | |
40 | 36 | | |
41 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
425 | 427 | | |
426 | 428 | | |
427 | 429 | | |
428 | | - | |
429 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
430 | 435 | | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
| 436 | + | |
| 437 | + | |
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
442 | 443 | | |
| 444 | + | |
443 | 445 | | |
444 | 446 | | |
445 | 447 | | |
446 | 448 | | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
458 | 454 | | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
473 | | - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
0 commit comments