Commit 6f3b1ca
Unify Table representations (#1256)
* Migrate Table → TableProvider; refactor registration and access, update
docs/tests, add DataFrame view support, and improve Send/concurrency
support.
migrates the codebase from using `Table` to a
`TableProvider`-based API, refactors registration and access paths to
simplify catalog/context interactions, and updates documentation and
examples. DataFrame view handling is improved (`into_view` is now
public), the test-suite is expanded to cover new registration and async
SQL scenarios, and `TableProvider` now supports the `Send` trait across
modules for safer concurrency. Minor import cleanup and utility
adjustments (including a refined `pyany_to_table_provider`) are
included.
* Refactors and bug fixes around TableProvider registration and
DataFrame→TableProvider conversion, plus tests and FFI/pycapsule
improvements.
-- Registration logic & API
* Refactor of table provider registration logic for improved clarity and
simpler call sites.
* Remove PyTableProvider registration from an internal module (reduces
surprising side effects).
* Update table registration method to call `register_table` instead of
`register_table_provider`.
* Extend `register_table` to support `TableProviderExportable` so more
provider types can be registered uniformly.
* Improve error messages related to registration failures (missing
PyCapsule name and DataFrame registration errors).
-- DataFrame ↔ TableProvider conversions
* Introduce utility functions to simplify table provider conversions and
centralize conversion logic.
* Rename `into_view_provider` → `to_view_provider` for clearer intent.
* Fix `from_dataframe` to return the correct type and update
`DataFrame.into_view` to import the correct `TableProvider`.
* Remove an obsolete `dataframe_into_view` test case after the refactor.
-- FFI / PyCapsule handling
* Update `FFI_TableProvider` initialization to accept an optional
parameter (improves FFI ergonomics).
* Introduce `table_provider_from_pycapsule` utility to standardize
pycapsule-based construction.
* Improve the error message when a PyCapsule name is missing to help
debugging.
-- DeltaTable & specific integrations
* Update TableProvider registration for `DeltaTable` to use the correct
registration method (matches the new API surface).
-- Tests, docs & minor fixes
* Add tests for registering a `TableProvider` from a `DataFrame` and
from a capsule to ensure conversion paths are covered.
* Fix a typo in the `register_view` docstring and another typo in the
error message for unsupported volatility type.
* Simplify version retrieval by removing exception handling around
`PackageNotFoundError` (streamlines code path).
* TableProvider refactor & PyDataFrame integration
* Removed unused helpers (`extract_table_provider`, `_wrap`) and dead code to simplify maintenance.
* Consolidated and streamlined table-provider extraction and registration logic; improved error handling and replaced a hardcoded error message with `EXPECTED_PROVIDER_MSG`.
* Marked `from_view` as deprecated; updated deprecation message formatting and adjusted the warning `stacklevel` so it points to caller code.
* Removed the `Send` marker from TableProvider trait objects to increase type flexibility — review threading assumptions.
* Added type hints to `register_schema` and `deregister_table` methods.
* Adjusted tests and exceptions (e.g., changed one test to expect `RuntimeError`) and updated test coverage accordingly.
* Introduced a refactored `TableProvider` class and enhanced Python integration by adding support for extracting `PyDataFrame` in `PySchema`.
Notes:
* Consumers should migrate away from `TableProvider::from_view` to the new TableProvider integration.
* Audit any code relying on `Send` for trait objects passed across threads.
* Update downstream tests and documentation to reflect the changed exception types and deprecation.
* Normalize & simplify TableProvider/DataFrame registration; add
utilities, docs, and robustness fixes
* Normalized table-provider handling and simplified registration flow
across the codebase; multiple commits centralize provider coercion and
normalization.
* Introduced utility helpers (`coerce_table_provider`,
`extract_table_provider`, `_normalize_table_provider`) to centralize
extraction, error handling, and improve clarity.
* Simplified `from_dataframe` / `into_view` behavior: clearer
implementations, direct returns of DataFrame views where appropriate,
and added internal tests for DataFrame flows.
* Fixed DataFrame registration semantics: enforce `TypeError` for
invalid registrations; added handling for `DataFrameWrapper` by
converting it to a view.
* Added tests, including a schema registration test using a PyArrow
dataset and internal DataFrame tests to cover new flows.
* Documentation improvements: expanded `from_dataframe` docstrings with
parameter details, added usage examples for `into_view`, and
documented deprecations (e.g., `register_table_provider` →
`register_table`).
* Warning and UX fixes: synchronized deprecation `stacklevel` so
warnings point to caller code; improved `__dir__` to return sorted,
unique attributes.
* Cleanup: removed unused imports (including an unused error import from
`utils.rs`) and other dead code to reduce noise.
* refactor: update documentation for DataFrame to Table Provider conversion
* refactor: replace to_view_provider with inner_df for DataFrame access
* refactor: streamline TableProvider creation from DataFrame by consolidating method calls
* fix ruff errors
* refactor: enhance autoapi_skip_member_fn to skip private variables and avoid documentation duplication
* revert main 49.0.0 md
* refactor: add comment in autoapi_skip_member_fn
* refactor: remove isort and ruff comments to clean up import section
* docs: enhance docstring for DataFrame.into_view method to clarify usage and advantages
* docs: update example in DataFrame.into_view docstring for clarity
* docs: update example for registering Delta Lake tables to simplify usage
* docs: update table provider documentation for clarity and deprecate old methods
* docs: update documentation to reflect removal of TableProvider and usage of Table instead
* remove TableProvider in Python, update missing_exports function, doc
* Fix Ruff errors
* Refactor test_table_loading to use Table instead of TableProvider
* Refactor aggregate tests to simplify result assertions and improve readability
* Add comments to clarify table normalization in aggregate tests
* Initial implementation of unified table suggestion
* update unit tests
* Change documentation to be more user oriented
* Update ffi examples
* Update documentation
* More documentation
* Make documentation more user facing
* More documentation updates
* remove cruft
* fix ordering
* give read_table the same treatment
* Reuse Table constructor to idenfity non-ffi tables when using udtf
---------
Co-authored-by: Siew Kam Onn <[email protected]>1 parent af1c07b commit 6f3b1ca
File tree
23 files changed
+426
-289
lines changed- docs/source
- contributor-guide
- user-guide
- io
- examples/datafusion-ffi-example/python/tests
- python
- datafusion
- tests
- src
23 files changed
+426
-289
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
94 | 101 | | |
95 | 102 | | |
96 | 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 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
| 157 | + | |
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | | - | |
| 42 | + | |
| 43 | + | |
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
50 | | - | |
51 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | | - | |
57 | 59 | | |
58 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 40 | + | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
47 | 46 | | |
48 | 47 | | |
49 | 48 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 49 | + | |
54 | 50 | | |
55 | 51 | | |
56 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
| |||
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
85 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
| |||
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
129 | 138 | | |
130 | 139 | | |
131 | 140 | | |
| |||
139 | 148 | | |
140 | 149 | | |
141 | 150 | | |
142 | | - | |
| 151 | + | |
143 | 152 | | |
144 | | - | |
145 | | - | |
146 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
147 | 170 | | |
148 | 171 | | |
149 | 172 | | |
150 | | - | |
| 173 | + | |
151 | 174 | | |
152 | 175 | | |
| 176 | + | |
153 | 177 | | |
154 | | - | |
155 | | - | |
| 178 | + | |
| 179 | + | |
156 | 180 | | |
157 | 181 | | |
158 | 182 | | |
159 | 183 | | |
160 | | - | |
| 184 | + | |
161 | 185 | | |
162 | 186 | | |
163 | 187 | | |
164 | 188 | | |
165 | | - | |
| 189 | + | |
166 | 190 | | |
167 | 191 | | |
168 | 192 | | |
| |||
219 | 243 | | |
220 | 244 | | |
221 | 245 | | |
222 | | - | |
223 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
224 | 250 | | |
225 | 251 | | |
226 | 252 | | |
227 | 253 | | |
228 | 254 | | |
229 | | - | |
| 255 | + | |
230 | 256 | | |
231 | 257 | | |
232 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
| 50 | + | |
| 51 | + | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
733 | 740 | | |
734 | 741 | | |
735 | 742 | | |
736 | | - | |
| 743 | + | |
737 | 744 | | |
738 | 745 | | |
739 | 746 | | |
| |||
742 | 749 | | |
743 | 750 | | |
744 | 751 | | |
745 | | - | |
746 | | - | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
747 | 758 | | |
748 | | - | |
| 759 | + | |
| 760 | + | |
749 | 761 | | |
750 | 762 | | |
751 | 763 | | |
752 | | - | |
| 764 | + | |
753 | 765 | | |
754 | | - | |
| 766 | + | |
755 | 767 | | |
756 | 768 | | |
757 | 769 | | |
| |||
770 | 782 | | |
771 | 783 | | |
772 | 784 | | |
| 785 | + | |
773 | 786 | | |
774 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
775 | 790 | | |
776 | 791 | | |
777 | 792 | | |
778 | | - | |
779 | | - | |
| 793 | + | |
780 | 794 | | |
781 | | - | |
| 795 | + | |
782 | 796 | | |
783 | 797 | | |
784 | 798 | | |
| |||
1163 | 1177 | | |
1164 | 1178 | | |
1165 | 1179 | | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
1174 | 1185 | | |
1175 | 1186 | | |
1176 | 1187 | | |
| |||
0 commit comments