Skip to content

Commit 5fc66d6

Browse files
committed
feat: add __datafusion_table_provider__ method to Table class for FFI compatibility
1 parent 44ab9fb commit 5fc66d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

python/datafusion/catalog.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,14 @@ def __repr__(self) -> str:
149149
"""Print a string representation of the table."""
150150
return self.table.__repr__()
151151

152+
def __datafusion_table_provider__(self) -> object: # noqa: D105
153+
"""Expose the internal DataFusion table provider PyCapsule.
154+
155+
This forwards the call to the underlying Rust-backed RawTable so the
156+
object can be used as a TableProviderExportable by the FFI layer.
157+
"""
158+
return self.table.__datafusion_table_provider__()
159+
152160
@staticmethod
153161
def from_dataset(dataset: pa.dataset.Dataset) -> Table:
154162
"""Turn a pyarrow Dataset into a Table."""

0 commit comments

Comments
 (0)