@@ -19,6 +19,7 @@ use crate::dataset::Dataset;
19
19
use crate :: errors:: { py_datafusion_err, to_datafusion_err, PyDataFusionError , PyDataFusionResult } ;
20
20
use crate :: utils:: {
21
21
get_tokio_runtime, try_table_provider_from_object, validate_pycapsule, wait_for_future,
22
+ TABLE_PROVIDER_CAPSULE_NAME ,
22
23
} ;
23
24
use async_trait:: async_trait;
24
25
use datafusion:: catalog:: { MemoryCatalogProvider , MemorySchemaProvider } ;
@@ -36,7 +37,6 @@ use pyo3::types::PyCapsule;
36
37
use pyo3:: IntoPyObjectExt ;
37
38
use std:: any:: Any ;
38
39
use std:: collections:: HashSet ;
39
- use std:: ffi:: CString ;
40
40
use std:: sync:: Arc ;
41
41
42
42
#[ pyclass( name = "RawCatalog" , module = "datafusion.catalog" , subclass) ]
@@ -257,14 +257,13 @@ impl PyTable {
257
257
& self ,
258
258
py : Python < ' py > ,
259
259
) -> PyResult < Bound < ' py , PyCapsule > > {
260
- let name = CString :: new ( "datafusion_table_provider" ) . unwrap ( ) ;
261
260
let runtime = get_tokio_runtime ( ) . 0 . handle ( ) . clone ( ) ;
262
261
263
262
let provider = Arc :: clone ( & self . table ) ;
264
263
let provider: Arc < dyn TableProvider + Send > = provider;
265
264
let provider = FFI_TableProvider :: new ( provider, false , Some ( runtime) ) ;
266
265
267
- PyCapsule :: new ( py, provider, Some ( name . clone ( ) ) )
266
+ PyCapsule :: new ( py, provider, Some ( TABLE_PROVIDER_CAPSULE_NAME . to_owned ( ) ) )
268
267
}
269
268
270
269
fn __repr__ ( & self ) -> PyResult < String > {
0 commit comments