kosiew commented on code in PR #1243:
URL: 
https://github.com/apache/datafusion-python/pull/1243#discussion_r2366575519


##########
python/datafusion/dataframe.py:
##########
@@ -313,9 +315,29 @@ def __init__(self, df: DataFrameInternal) -> None:
         """
         self.df = df
 
-    def into_view(self) -> pa.Table:
-        """Convert DataFrame as a ViewTable which can be used in 
register_table."""
-        return self.df.into_view()
+    def into_view(self) -> TableProvider:
+        """Convert ``DataFrame`` into a ``TableProvider`` view for 
registration.
+
+        This is the preferred way to obtain a view for
+        :py:meth:`~datafusion.context.SessionContext.register_table`.
+        ``datafusion.TableProvider.from_dataframe`` calls this method under 
the hood,
+        and the older ``TableProvider.from_view`` helper is deprecated.
+
+        The ``DataFrame`` remains valid after conversion, so it can still be 
used for
+        additional queries alongside the returned view.
+
+        Examples:
+            >>> from datafusion import SessionContext
+            >>> ctx = SessionContext()
+            >>> df = ctx.sql("SELECT 1 AS value")
+            >>> provider = df.into_view()

Review Comment:
   This makes sense, given that we're moving away from 'provider'



-- 
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]

Reply via email to