Skip to content

Commit 25d4141

Browse files
committed
Make documentation more user facing
1 parent 90b3cb6 commit 25d4141

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

python/datafusion/catalog.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,6 @@ def register_table( # noqa: B027
250250
251251
This method is optional. If your schema provides a fixed list of tables, you do
252252
not need to implement this method.
253-
254-
Objects implementing ``__datafusion_table_provider__`` are also supported
255-
and treated as table provider instances.
256253
"""
257254

258255
def deregister_table(self, name: str, cascade: bool) -> None: # noqa: B027

python/datafusion/context.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -759,13 +759,6 @@ def register_table(
759759
The registered table can be referenced from SQL statements executed against
760760
this context.
761761
762-
Plain :py:class:`~datafusion.dataframe.DataFrame` objects are not supported;
763-
convert them first with :meth:`datafusion.dataframe.DataFrame.into_view` or
764-
:meth:`datafusion.Table.from_dataframe`.
765-
766-
Objects implementing ``__datafusion_table_provider__`` are also supported
767-
and treated as table provider instances.
768-
769762
Args:
770763
name: Name of the resultant table.
771764
table: DataFusion :class:`Table` or any object implementing
@@ -790,21 +783,16 @@ def register_catalog_provider(
790783
else:
791784
self.ctx.register_catalog_provider(name, provider)
792785

786+
@deprecated("Use register_table() instead.")
793787
def register_table_provider(
794-
self, name: str, provider: Table | TableProviderExportable | Any
788+
self,
789+
name: str,
790+
provider: Table | TableProviderExportable | DataFrame | pa.dataset.Dataset,
795791
) -> None:
796792
"""Register a table provider.
797793
798794
Deprecated: use :meth:`register_table` instead.
799-
800-
Objects implementing ``__datafusion_table_provider__`` are also supported
801-
and treated as table provider instances.
802795
"""
803-
warnings.warn(
804-
"register_table_provider is deprecated; use register_table",
805-
DeprecationWarning,
806-
stacklevel=2,
807-
)
808796
self.register_table(name, provider)
809797

810798
def register_udtf(self, func: TableFunction) -> None:

0 commit comments

Comments
 (0)