@@ -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() ``.
0 commit comments