Skip to content

Commit cb7a755

Browse files
committed
Change documentation to be more user oriented
1 parent 49abaeb commit cb7a755

File tree

5 files changed

+5
-92
lines changed

5 files changed

+5
-92
lines changed

docs/source/conf.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ def autoapi_skip_member_fn(app, what, name, obj, skip, options) -> bool: # noqa
8383
# Duplicate modules (skip module-level docs to avoid duplication)
8484
("module", "datafusion.col"),
8585
("module", "datafusion.udf"),
86-
# Private variables causing duplicate documentation
87-
("data", "datafusion.utils._PYARROW_DATASET_TYPES"),
88-
("variable", "datafusion.utils._PYARROW_DATASET_TYPES"),
8986
# Deprecated
9087
("class", "datafusion.substrait.serde"),
9188
("class", "datafusion.substrait.plan"),
@@ -104,18 +101,6 @@ def autoapi_skip_member_fn(app, what, name, obj, skip, options) -> bool: # noqa
104101
if (what, name) in skip_contents:
105102
skip = True
106103

107-
# Skip private module-level names (those whose final component
108-
# starts with an underscore) when AutoAPI is rendering data or
109-
# variable entries. Many internal module-level constants are
110-
# implementation details (for example private pyarrow dataset type
111-
# mappings) that would otherwise be emitted as top-level "data"
112-
# or "variable" docs. Filtering them here avoids noisy,
113-
# duplicate, or implementation-specific entries in the public
114-
# documentation while still allowing public members and types to
115-
# be documented normally.
116-
if name.split(".")[-1].startswith("_") and what in ("data", "variable"):
117-
skip = True
118-
119104
return skip
120105

121106

docs/source/contributor-guide/ffi.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ as performant as possible and to utilize the features of DataFusion, you may dec
3434
your source in Rust and then expose it through `PyO3 <https://pyo3.rs>`_ as a Python library.
3535

3636
At first glance, it may appear the best way to do this is to add the ``datafusion-python``
37-
crate as a dependency, produce a DataFusion table in Rust, and then register it with the
37+
crate as a dependency, provide a ``PyTable``, and then to register it with the
3838
``SessionContext``. Unfortunately, this will not work.
3939

4040
When you produce your code as a Python library and it needs to interact with the DataFusion

docs/source/user-guide/data-sources.rst

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -155,22 +155,10 @@ as Delta Lake. This will require a recent version of
155155
from datafusion import Table
156156
157157
delta_table = DeltaTable("path_to_table")
158-
table = Table.from_capsule(delta_table.__datafusion_table_provider__())
159-
ctx.register_table("my_delta_table", table)
158+
ctx.register_table("my_delta_table", delta_table)
160159
df = ctx.table("my_delta_table")
161160
df.show()
162161
163-
Objects that implement ``__datafusion_table_provider__`` are supported directly by
164-
:py:meth:`~datafusion.context.SessionContext.register_table`, making it easy to
165-
work with custom table providers from Python libraries such as Delta Lake.
166-
167-
.. note::
168-
169-
:py:meth:`~datafusion.context.SessionContext.register_table_provider` is
170-
deprecated. Use
171-
:py:meth:`~datafusion.context.SessionContext.register_table` with a
172-
:py:class:`~datafusion.Table` instead.
173-
174162
On older versions of ``deltalake`` (prior to 0.22) you can use the
175163
`Arrow DataSet <https://arrow.apache.org/docs/python/generated/pyarrow.dataset.Dataset.html>`_
176164
interface to import to DataFusion, but this does not support features such as filter push down

docs/source/user-guide/io/table_provider.rst

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ A complete example can be found in the `examples folder <https://github.com/apac
3737
&self,
3838
py: Python<'py>,
3939
) -> PyResult<Bound<'py, PyCapsule>> {
40-
let name = CString::new("datafusion_table_provider").unwrap();
40+
let name = cr"datafusion_table_provider".into();
4141
4242
let provider = Arc::new(self.clone());
4343
let provider = FFI_TableProvider::new(provider, false, None);
@@ -48,18 +48,7 @@ A complete example can be found in the `examples folder <https://github.com/apac
4848
4949
Once you have this library available, you can construct a
5050
:py:class:`~datafusion.Table` in Python and register it with the
51-
``SessionContext``. Tables can be created either from the PyCapsule exposed by your
52-
Rust provider or from an existing :py:class:`~datafusion.dataframe.DataFrame`.
53-
Call the provider's ``__datafusion_table_provider__()`` method to obtain the capsule
54-
before constructing a ``Table``. The ``Table.from_view()`` helper is
55-
deprecated; instead use ``Table.from_dataframe()`` or ``DataFrame.into_view()``.
56-
57-
.. note::
58-
59-
:py:meth:`~datafusion.context.SessionContext.register_table_provider` is
60-
deprecated. Use
61-
:py:meth:`~datafusion.context.SessionContext.register_table` with the
62-
resulting :py:class:`~datafusion.Table` instead.
51+
``SessionContext``.
6352

6453
.. code-block:: python
6554
@@ -68,18 +57,6 @@ deprecated; instead use ``Table.from_dataframe()`` or ``DataFrame.into_view()``.
6857
ctx = SessionContext()
6958
provider = MyTableProvider()
7059
71-
capsule = provider.__datafusion_table_provider__()
72-
capsule_table = Table.from_capsule(capsule)
73-
74-
df = ctx.from_pydict({"a": [1]})
75-
view_table = Table.from_dataframe(df)
76-
# or: view_table = df.into_view()
77-
78-
ctx.register_table("capsule_table", capsule_table)
79-
ctx.register_table("view_table", view_table)
60+
ctx.register_table("capsule_table", provider)
8061
8162
ctx.table("capsule_table").show()
82-
ctx.table("view_table").show()
83-
84-
Both ``Table.from_capsule()`` and ``Table.from_dataframe()`` create
85-
table providers that can be registered with the SessionContext using ``register_table()``.

python/datafusion/utils.py

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)