File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -319,7 +319,17 @@ def into_view(self) -> TableProvider:
319319 """Convert ``DataFrame`` into a ``TableProvider`` view for registration.
320320
321321 This is the preferred way to obtain a view for
322- :py:meth:`~datafusion.context.SessionContext.register_table`.
322+ :py:meth:`~datafusion.context.SessionContext.register_table` for several reasons:
323+
324+ 1. **Direct API**: Most efficient path - directly calls the underlying Rust
325+ ``DataFrame.into_view()`` method without intermediate delegations.
326+ 2. **Clear semantics**: The ``into_`` prefix follows Rust conventions,
327+ indicating conversion from one type to another.
328+ 3. **Canonical method**: Other approaches like ``TableProvider.from_dataframe``
329+ delegate to this method internally, making this the single source of truth.
330+ 4. **Deprecated alternatives**: The older ``TableProvider.from_view`` helper
331+ is deprecated and issues warnings when used.
332+
323333 ``datafusion.TableProvider.from_dataframe`` calls this method under the hood,
324334 and the older ``TableProvider.from_view`` helper is deprecated.
325335
You can’t perform that action at this time.
0 commit comments