We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d4387c commit 72afd1cCopy full SHA for 72afd1c
1 file changed
python/datafusion/context.py
@@ -24,8 +24,6 @@
24
25
import pyarrow as pa
26
27
-from datafusion import EXPECTED_PROVIDER_MSG
28
-
29
try:
30
from warnings import deprecated # Python 3.13+
31
except ImportError:
@@ -769,13 +767,8 @@ def register_table(
769
767
implementing ``__datafusion_table_provider__`` to add to the session
770
768
context.
771
"""
772
- if isinstance(table, DataFrame):
773
- raise TypeError(EXPECTED_PROVIDER_MSG)
774
775
- if isinstance(table, Table):
776
- self.ctx.register_table(name, table.table)
777
- else:
778
- self.ctx.register_table(name, table)
+ provider = _normalize_table_provider(table)
+ self.ctx.register_table(name, provider)
779
780
def deregister_table(self, name: str) -> None:
781
"""Remove a table from the session."""
0 commit comments