Commit dc0d35a
authored
Add Interruptible Query Execution in Jupyter via KeyboardInterrupt Support (#1141)
* fix: enhance error handling in async wait_for_future function
* feat: implement async execution for execution plans in PySessionContext
* fix: improve error message for execution failures in PySessionContext
* fix: enhance error handling and improve execution plan retrieval in PyDataFrame
* fix: ensure 'static lifetime for futures in wait_for_future function
* fix: handle potential errors when caching DataFrame and retrieving execution plan
* fix: flatten batches in PyDataFrame to ensure proper schema conversion
* fix: correct error handling in batch processing for schema conversion
* fix: flatten nested structure in PyDataFrame to ensure proper RecordBatch iteration
* fix: improve error handling in PyDataFrame stream execution
* fix: add utility to get Tokio Runtime with time enabled and update wait_for_future to use it
* fix: store result of converting RecordBatches to PyArrow for debugging
* fix: handle error from wait_for_future in PyDataFrame collect method
* fix: propagate error from wait_for_future in collect_partitioned method
* fix: enable IO in Tokio runtime with time support
* main register_listing_table
* Revert "main register_listing_table"
This reverts commit 52a5efe.
* fix: propagate error correctly from wait_for_future in PySessionContext methods
* fix: simplify error handling in PySessionContext by unwrapping wait_for_future result
* test: add interruption handling test for long-running queries in DataFusion
* test: move test_collect_interrupted to test_dataframe.py
* fix: add const for interval in wait_for_future utility
* fix: use get_tokio_runtime instead of the custom get_runtime
* Revert "fix: use get_tokio_runtime instead of the custom get_runtime"
This reverts commit ca2d892.
* fix: use get_tokio_runtime instead of the custom get_runtime
* .
* Revert "."
This reverts commit b8ce3e4.
* fix: improve query interruption handling in test_collect_interrupted
* fix: ensure proper handling of query interruption in test_collect_interrupted
* fix: improve error handling in database table retrieval
* refactor: add helper for async move
* Revert "refactor: add helper for async move"
This reverts commit faabf6d.
* move py_err_to_datafusion_err to errors.rs
* add create_csv_read_options
* fix
* create_csv_read_options -> PyDataFusionResult
* revert to before create_csv_read_options
* refactor: simplify file compression type parsing in PySessionContext
* fix: parse_compression_type once only
* add create_ndjson_read_options
* refactor comment for clarity in wait_for_future function
* refactor wait_for_future to avoid spawn
* remove unused py_err_to_datafusion_err function
* add comment to clarify error handling in next method of PyRecordBatchStream
* handle error from wait_for_future in PySubstraitSerializer
* clarify comment on future pinning in wait_for_future function
* refactor wait_for_future to use Duration for signal check interval
* handle error from wait_for_future in count method of PyDataFrame
* fix ruff errors
* fix clippy errors
* remove unused get_and_enter_tokio_runtime function and simplify wait_for_future
* Refactor async handling in PySessionContext and PyDataFrame
- Simplified async handling by removing unnecessary cloning of strings and context in various methods.
- Streamlined the use of `wait_for_future` to directly handle futures without intermediate variables.
- Improved error handling by directly propagating results from futures.
- Enhanced readability by reducing boilerplate code in methods related to reading and writing data.
- Updated the `wait_for_future` function to improve signal checking and future handling.
* Organize imports in utils.rs for improved readability
* map_err instead of panic
* Fix error handling in async stream execution for PySessionContext and PyDataFrame1 parent d6ef9bc commit dc0d35a
File tree
7 files changed
+211
-66
lines changed- python/tests
- src
7 files changed
+211
-66
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
20 | 23 | | |
21 | 24 | | |
22 | 25 | | |
| |||
2060 | 2063 | | |
2061 | 2064 | | |
2062 | 2065 | | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
| 2097 | + | |
| 2098 | + | |
| 2099 | + | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
| 2135 | + | |
| 2136 | + | |
| 2137 | + | |
| 2138 | + | |
| 2139 | + | |
| 2140 | + | |
| 2141 | + | |
| 2142 | + | |
| 2143 | + | |
| 2144 | + | |
| 2145 | + | |
| 2146 | + | |
| 2147 | + | |
| 2148 | + | |
| 2149 | + | |
| 2150 | + | |
| 2151 | + | |
| 2152 | + | |
| 2153 | + | |
| 2154 | + | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
| 2160 | + | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
| 2166 | + | |
| 2167 | + | |
| 2168 | + | |
| 2169 | + | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
| 2175 | + | |
| 2176 | + | |
| 2177 | + | |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | | - | |
| 378 | + | |
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
| 403 | + | |
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
| 420 | + | |
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
| |||
451 | 451 | | |
452 | 452 | | |
453 | 453 | | |
454 | | - | |
| 454 | + | |
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| |||
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
653 | | - | |
| 653 | + | |
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
696 | | - | |
| 696 | + | |
697 | 697 | | |
698 | 698 | | |
699 | 699 | | |
700 | | - | |
| 700 | + | |
701 | 701 | | |
702 | 702 | | |
703 | 703 | | |
| |||
734 | 734 | | |
735 | 735 | | |
736 | 736 | | |
737 | | - | |
| 737 | + | |
738 | 738 | | |
739 | 739 | | |
740 | 740 | | |
| |||
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
767 | | - | |
| 767 | + | |
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
| |||
825 | 825 | | |
826 | 826 | | |
827 | 827 | | |
828 | | - | |
| 828 | + | |
829 | 829 | | |
830 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
831 | 841 | | |
832 | 842 | | |
833 | 843 | | |
| |||
865 | 875 | | |
866 | 876 | | |
867 | 877 | | |
868 | | - | |
| 878 | + | |
869 | 879 | | |
870 | 880 | | |
871 | | - | |
| 881 | + | |
872 | 882 | | |
873 | 883 | | |
874 | 884 | | |
| |||
915 | 925 | | |
916 | 926 | | |
917 | 927 | | |
918 | | - | |
| 928 | + | |
919 | 929 | | |
920 | 930 | | |
921 | 931 | | |
922 | 932 | | |
923 | | - | |
| 933 | + | |
924 | 934 | | |
925 | 935 | | |
926 | 936 | | |
| |||
958 | 968 | | |
959 | 969 | | |
960 | 970 | | |
961 | | - | |
| 971 | + | |
962 | 972 | | |
963 | 973 | | |
964 | 974 | | |
| |||
978 | 988 | | |
979 | 989 | | |
980 | 990 | | |
981 | | - | |
| 991 | + | |
982 | 992 | | |
983 | 993 | | |
984 | | - | |
| 994 | + | |
985 | 995 | | |
986 | 996 | | |
987 | 997 | | |
| |||
1021 | 1031 | | |
1022 | 1032 | | |
1023 | 1033 | | |
1024 | | - | |
1025 | | - | |
| 1034 | + | |
| 1035 | + | |
1026 | 1036 | | |
1027 | 1037 | | |
1028 | 1038 | | |
| |||
0 commit comments