davisp commented on code in PR #1396:
URL:
https://github.com/apache/datafusion-python/pull/1396#discussion_r2921286313
##########
python/datafusion/context.py:
##########
@@ -830,6 +831,20 @@ def deregister_table(self, name: str) -> None:
"""Remove a table from the session."""
self.ctx.deregister_table(name)
+ def register_table_factory(
+ self, format: str, factory: TableProviderFactoryExportable
+ ) -> None:
+ """Register a :py:class:`~datafusion.TableProviderFactoryExportable`.
+
+ The registered factory can be reference from SQL DDL statements
executed
+ against this context.
+
+ Args:
+ format: The value to be used in `STORED AS ${format}` clause.
+ factory: A PyCapsule that implements
TableProviderFactoryExportable"
+ """
+ self.ctx.register_table_factory(format, factory)
Review Comment:
Not sure how I missed it earlier, but the only reason I didn't initially
provide the ability for Python based implementations was because I didn't want
to make this PR messy attempting to make FFI bindings for the
`CreateExternalTable` logical expression. Something made me look a bit harder
and realized its already been wrapped so I've gone back and added it in [this
commit](https://github.com/apache/datafusion-python/pull/1396/commits/33be408fd0249b20e9e0242311d2745050b57c6a).
Also, the robot didn't manage to realize that the FFI example bindings are
tested in CI so that part was a non-issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]