Skip to content

Commit

Permalink
Add wrapper for register table provider
Browse files Browse the repository at this point in the history
  • Loading branch information
timsaucer committed Nov 11, 2024
1 parent 2764bca commit fbf54f1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/datafusion/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,14 @@ def deregister_table(self, name: str) -> None:
"""Remove a table from the session."""
self.ctx.deregister_table(name)

def register_table_provider(self, name: str, provider: Any) -> None:
"""Register a table provider.
This table provider must have a method called ``__datafusion_table_provider__``
which returns a PyCapsule that exposes a ``FFI_TableProvider``.
"""
self.ctx.register_table_provider(name, provider)

def register_record_batches(
self, name: str, partitions: list[list[pyarrow.RecordBatch]]
) -> None:
Expand Down

0 comments on commit fbf54f1

Please sign in to comment.