Skip to content

Commit 904c1ca

Browse files
committed
feat: add support for automatic registration of Polars DataFrame in SessionContext
1 parent dc1b392 commit 904c1ca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

python/datafusion/context.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,13 @@ def _register_python_object(self, name: str, obj: Any) -> bool:
801801
self.register_view(name, obj)
802802
return True
803803

804+
if (
805+
obj.__class__.__module__.startswith("polars.")
806+
and obj.__class__.__name__ == "DataFrame"
807+
):
808+
self.from_polars(obj, name=name)
809+
return True
810+
804811
if (
805812
obj.__class__.__module__.startswith("pandas.")
806813
and obj.__class__.__name__ == "DataFrame"

0 commit comments

Comments
 (0)