Skip to content

Commit 7240d44

Browse files
committed
Rebasing and pulling in a few changes for DF43.0
1 parent 3dfb266 commit 7240d44

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/context.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use std::str::FromStr;
2121
use std::sync::Arc;
2222

2323
use arrow::array::RecordBatchReader;
24-
use arrow::ffi::FFI_ArrowSchema;
2524
use arrow::ffi_stream::ArrowArrayStreamReader;
2625
use arrow::pyarrow::FromPyArrow;
2726
use datafusion::execution::session_state::SessionStateBuilder;
@@ -37,7 +36,6 @@ use crate::dataframe::PyDataFrame;
3736
use crate::dataset::Dataset;
3837
use crate::errors::{py_datafusion_err, DataFusionError};
3938
use crate::expr::sort_expr::PySortExpr;
40-
use crate::expr::PyExpr;
4139
use crate::physical_plan::PyExecutionPlan;
4240
use crate::record_batch::PyRecordBatchStream;
4341
use crate::sql::logical::PyLogicalPlan;
@@ -56,8 +54,8 @@ use datafusion::datasource::file_format::parquet::ParquetFormat;
5654
use datafusion::datasource::listing::{
5755
ListingOptions, ListingTable, ListingTableConfig, ListingTableUrl,
5856
};
57+
use datafusion::datasource::MemTable;
5958
use datafusion::datasource::TableProvider;
60-
use datafusion::datasource::{provider, MemTable};
6159
use datafusion::execution::context::{
6260
DataFilePaths, SQLOptions, SessionConfig, SessionContext, TaskContext,
6361
};
@@ -574,15 +572,14 @@ impl PySessionContext {
574572
&mut self,
575573
name: &str,
576574
provider: Bound<'_, PyAny>,
577-
py: Python,
578575
) -> PyResult<()> {
579576
if provider.hasattr("__datafusion_table_provider__")? {
580577
let capsule = provider.getattr("__datafusion_table_provider__")?.call0()?;
581578
let capsule = capsule.downcast::<PyCapsule>()?;
582579
// validate_pycapsule(capsule, "arrow_array_stream")?;
583580

584581
let provider = unsafe { capsule.reference::<FFI_TableProvider>() };
585-
let provider = ForeignTableProvider::new(provider);
582+
let provider: ForeignTableProvider = provider.into();
586583

587584
let _ = self.ctx.register_table(name, Arc::new(provider))?;
588585
}

src/udf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl PyScalarUDF {
9797
let function = create_udf(
9898
name,
9999
input_types.0,
100-
Arc::new(return_type.0),
100+
return_type.0,
101101
parse_volatility(volatility)?,
102102
to_scalar_function_impl(func),
103103
);

0 commit comments

Comments
 (0)