@@ -34,7 +34,7 @@ as performant as possible and to utilize the features of DataFusion, you may dec
3434your source in Rust and then expose it through `PyO3 <https://pyo3.rs >`_ as a Python library.
3535
3636At first glance, it may appear the best way to do this is to add the ``datafusion-python ``
37- crate as a dependency and then provide a ``PyTable `` and then to 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
4040When you produce your code as a Python library and it needs to interact with the DataFusion
@@ -74,7 +74,7 @@ code that does **not** require the ``datafusion-python`` crate as a dependency,
7474code in Python via PyO3, and have it interact with the DataFusion Python package.
7575
7676Early adopters of this approach include `delta-rs <https://delta-io.github.io/delta-rs/ >`_
77- who has adapted their Table Provider for use in `datafusion-python ` with only a few lines
77+ who has adapted their Table Provider for use in `` ` datafusion-python` ` ` with only a few lines
7878of code. Also, the DataFusion Python project uses the existing definitions from
7979`Apache Arrow CStream Interface <https://arrow.apache.org/docs/format/CStreamInterface.html >`_
8080to support importing **and ** exporting tables. Any Python package that supports reading
@@ -90,7 +90,7 @@ Inspiration from Arrow
9090
9191DataFusion is built upon `Apache Arrow <https://arrow.apache.org/ >`_. The canonical Python
9292Arrow implementation, `pyarrow <https://arrow.apache.org/docs/python/index.html >`_ provides
93- and excellent way to share Arrow data between Python projects without performing any copy
93+ an excellent way to share Arrow data between Python projects without performing any copy
9494operations on the data. They do this by using a well defined set of interfaces. You can
9595find the details about their stream interface
9696`here <https://arrow.apache.org/docs/format/CStreamInterface.html >`_. The
@@ -117,7 +117,7 @@ Implementation Details
117117
118118The bulk of the code necessary to perform our FFI operations is in the upstream
119119`DataFusion <https://datafusion.apache.org/ >`_ core repository. You can review the code and
120- documentation in the `datafusion-ffi < https://crates.io/crates/datafusion-ffi > `_ crate.
120+ documentation in the `datafusion-ffi `_ crate.
121121
122122Our FFI implementation is narrowly focused at sharing data and functions with Rust backed
123123libraries. This allows us to use the `abi_stable crate <https://crates.io/crates/abi_stable >`_.
@@ -127,7 +127,7 @@ you can simply convert it to a ``RVec<RString>`` in an intuitive manner. It also
127127features like ``RResult `` and ``ROption `` that do not have an obvious translation to a
128128C equivalent.
129129
130- The `datafusion-ffi ` crate has been designed to make it easy to convert from DataFusion
130+ The `datafusion-ffi `_ crate has been designed to make it easy to convert from DataFusion
131131traits into their FFI counterparts. For example, if you have defined a custom
132132`TableProvider <https://docs.rs/datafusion/45.0.0/datafusion/catalog/trait.TableProvider.html >`_
133133and you want to create a sharable FFI counterpart, you could write:
@@ -145,7 +145,7 @@ you needed to turn it back into an ``TableProvider``, you can turn it into a
145145
146146 let foreign_provider: ForeignTableProvider = ffi_provider.into();
147147
148- If you review the code in `datafusion-ffi ` you will find that each of the traits we share
148+ If you review the code in `datafusion-ffi `_ you will find that each of the traits we share
149149across the boundary has two portions, one with a ``FFI_ `` prefix and one with a ``Foreign ``
150150prefix. This is used to distinguish which side of the FFI boundary that struct is
151151designed to be used on. The structures with the ``FFI_ `` prefix are to be used on the
@@ -156,7 +156,7 @@ it is the ``datafusion-python`` library.
156156
157157In order to share these FFI structures, we need to wrap them in some kind of Python object
158158that can be used to interface from one package to another. As described in the above
159- section on our inspiration from Arrow, we use `PyCapsule `. We can create a PyCapsule
159+ section on our inspiration from Arrow, we use `` PyCapsule `` . We can create a `` PyCapsule ``
160160for our provider thusly:
161161
162162.. code-block :: rust
@@ -207,5 +207,6 @@ Status of Work
207207--------------
208208
209209At the time of this writing, the FFI features are under active development. To see
210- the latest status, we recommend reviewing the code in the
211- `DataFusion repository <https://github.com/apache/datafusion/tree/main/datafusion/ffi/ >`_.
210+ the latest status, we recommend reviewing the code in the `datafusion-ffi `_ crate.
211+
212+ .. _datafusion-ffi : https://crates.io/crates/datafusion-ffi
0 commit comments