Skip to content

Commit 6154ef9

Browse files
authored
chore: Use datafusion re-exported dependencies (#856)
* Use datafusion re-exported crates * update dependency export syntax
1 parent a0913c7 commit 6154ef9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+113
-118
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dist
2525
# intended to run in multiple environments; otherwise, check them in:
2626
.python-version
2727
venv
28+
.venv
2829

2930
apache-rat-*.jar
3031
*rat.txt

Cargo.lock

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ rand = "0.8"
3939
pyo3 = { version = "0.21", features = ["extension-module", "abi3", "abi3-py38"] }
4040
arrow = { version = "52", feature = ["pyarrow"] }
4141
datafusion = { version = "41.0.0", features = ["pyarrow", "avro", "unicode_expressions"] }
42-
datafusion-common = { version = "41.0.0", features = ["pyarrow"] }
43-
datafusion-expr = { version = "41.0.0" }
44-
datafusion-functions-nested = { version = "41.0.0" }
45-
datafusion-optimizer = { version = "41.0.0" }
46-
datafusion-sql = { version = "41.0.0" }
4742
datafusion-substrait = { version = "41.0.0", optional = true }
4843
prost = "0.12" # keep in line with `datafusion-substrait`
4944
prost-types = "0.12" # keep in line with `datafusion-substrait`
@@ -67,4 +62,4 @@ crate-type = ["cdylib", "rlib"]
6762
[profile.release]
6863
lto = true
6964
codegen-units = 1
70-
65+

src/common/data_type.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
use datafusion::arrow::array::Array;
1919
use datafusion::arrow::datatypes::{DataType, IntervalUnit, TimeUnit};
20-
use datafusion_common::{DataFusionError, ScalarValue};
21-
use datafusion_expr::sqlparser::ast::NullTreatment as DFNullTreatment;
20+
use datafusion::common::{DataFusionError, ScalarValue};
21+
use datafusion::logical_expr::sqlparser::ast::NullTreatment as DFNullTreatment;
2222
use pyo3::{exceptions::PyValueError, prelude::*};
2323

2424
use crate::errors::py_datafusion_err;

src/common/df_schema.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use std::sync::Arc;
1919

20-
use datafusion_common::DFSchema;
20+
use datafusion::common::DFSchema;
2121
use pyo3::prelude::*;
2222

2323
#[derive(Debug, Clone)]

src/common/schema.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
use std::any::Any;
1919

2020
use datafusion::arrow::datatypes::SchemaRef;
21-
use datafusion_expr::{Expr, TableProviderFilterPushDown, TableSource};
21+
use datafusion::logical_expr::{Expr, TableProviderFilterPushDown, TableSource};
2222
use pyo3::prelude::*;
2323

24-
use datafusion_expr::utils::split_conjunction;
24+
use datafusion::logical_expr::utils::split_conjunction;
2525

2626
use super::{data_type::DataTypeMap, function::SqlFunction};
2727

@@ -166,7 +166,7 @@ impl TableSource for SqlTableSource {
166166
fn supports_filter_pushdown(
167167
&self,
168168
filter: &Expr,
169-
) -> datafusion_common::Result<TableProviderFilterPushDown> {
169+
) -> datafusion::common::Result<TableProviderFilterPushDown> {
170170
let filters = split_conjunction(filter);
171171
if filters.iter().all(|f| is_supported_push_down_expr(f)) {
172172
// Push down filters to the tablescan operation if all are supported
@@ -180,22 +180,22 @@ impl TableSource for SqlTableSource {
180180
}
181181
}
182182

183-
fn table_type(&self) -> datafusion_expr::TableType {
184-
datafusion_expr::TableType::Base
183+
fn table_type(&self) -> datafusion::logical_expr::TableType {
184+
datafusion::logical_expr::TableType::Base
185185
}
186186

187187
#[allow(deprecated)]
188188
fn supports_filters_pushdown(
189189
&self,
190190
filters: &[&Expr],
191-
) -> datafusion_common::Result<Vec<TableProviderFilterPushDown>> {
191+
) -> datafusion::common::Result<Vec<TableProviderFilterPushDown>> {
192192
filters
193193
.iter()
194194
.map(|f| self.supports_filter_pushdown(f))
195195
.collect()
196196
}
197197

198-
fn get_logical_plan(&self) -> Option<&datafusion_expr::LogicalPlan> {
198+
fn get_logical_plan(&self) -> Option<&datafusion::logical_expr::LogicalPlan> {
199199
None
200200
}
201201
}

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
use pyo3::prelude::*;
1919
use pyo3::types::*;
2020

21+
use datafusion::common::ScalarValue;
2122
use datafusion::config::ConfigOptions;
22-
use datafusion_common::ScalarValue;
2323

2424
#[pyclass(name = "Config", module = "datafusion", subclass)]
2525
#[derive(Clone)]

src/context.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ use crate::utils::{get_tokio_runtime, wait_for_future};
4646
use datafusion::arrow::datatypes::{DataType, Schema, SchemaRef};
4747
use datafusion::arrow::pyarrow::PyArrowType;
4848
use datafusion::arrow::record_batch::RecordBatch;
49+
use datafusion::common::ScalarValue;
4950
use datafusion::datasource::file_format::file_compression_type::FileCompressionType;
5051
use datafusion::datasource::file_format::parquet::ParquetFormat;
5152
use datafusion::datasource::listing::{
@@ -61,7 +62,6 @@ use datafusion::physical_plan::SendableRecordBatchStream;
6162
use datafusion::prelude::{
6263
AvroReadOptions, CsvReadOptions, DataFrame, NdJsonReadOptions, ParquetReadOptions,
6364
};
64-
use datafusion_common::ScalarValue;
6565
use pyo3::types::{PyDict, PyList, PyTuple};
6666
use tokio::task::JoinHandle;
6767

@@ -962,15 +962,15 @@ impl PySessionContext {
962962
// create a Tokio runtime to run the async code
963963
let rt = &get_tokio_runtime(py).0;
964964
let plan = plan.plan.clone();
965-
let fut: JoinHandle<datafusion_common::Result<SendableRecordBatchStream>> =
965+
let fut: JoinHandle<datafusion::common::Result<SendableRecordBatchStream>> =
966966
rt.spawn(async move { plan.execute(part, Arc::new(ctx)) });
967967
let stream = wait_for_future(py, fut).map_err(py_datafusion_err)?;
968968
Ok(PyRecordBatchStream::new(stream?))
969969
}
970970
}
971971

972972
impl PySessionContext {
973-
async fn _table(&self, name: &str) -> datafusion_common::Result<DataFrame> {
973+
async fn _table(&self, name: &str) -> datafusion::common::Result<DataFrame> {
974974
self.ctx.table(name).await
975975
}
976976
}

src/dataframe.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ use arrow::util::display::{ArrayFormatter, FormatOptions};
2727
use datafusion::arrow::datatypes::Schema;
2828
use datafusion::arrow::pyarrow::{PyArrowType, ToPyArrow};
2929
use datafusion::arrow::util::pretty;
30+
use datafusion::common::UnnestOptions;
3031
use datafusion::config::{CsvOptions, TableParquetOptions};
3132
use datafusion::dataframe::{DataFrame, DataFrameWriteOptions};
3233
use datafusion::execution::SendableRecordBatchStream;
3334
use datafusion::parquet::basic::{BrotliLevel, Compression, GzipLevel, ZstdLevel};
3435
use datafusion::prelude::*;
35-
use datafusion_common::UnnestOptions;
3636
use pyo3::exceptions::{PyTypeError, PyValueError};
3737
use pyo3::prelude::*;
3838
use pyo3::pybacked::PyBackedStr;
@@ -541,7 +541,7 @@ impl PyDataFrame {
541541
// create a Tokio runtime to run the async code
542542
let rt = &get_tokio_runtime(py).0;
543543
let df = self.df.as_ref().clone();
544-
let fut: JoinHandle<datafusion_common::Result<SendableRecordBatchStream>> =
544+
let fut: JoinHandle<datafusion::common::Result<SendableRecordBatchStream>> =
545545
rt.spawn(async move { df.execute_stream().await });
546546
let stream = wait_for_future(py, fut).map_err(py_datafusion_err)?;
547547
Ok(PyRecordBatchStream::new(stream?))
@@ -551,7 +551,7 @@ impl PyDataFrame {
551551
// create a Tokio runtime to run the async code
552552
let rt = &get_tokio_runtime(py).0;
553553
let df = self.df.as_ref().clone();
554-
let fut: JoinHandle<datafusion_common::Result<Vec<SendableRecordBatchStream>>> =
554+
let fut: JoinHandle<datafusion::common::Result<Vec<SendableRecordBatchStream>>> =
555555
rt.spawn(async move { df.execute_stream_partitioned().await });
556556
let stream = wait_for_future(py, fut).map_err(py_datafusion_err)?;
557557

src/dataset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ use datafusion::arrow::datatypes::SchemaRef;
3131
use datafusion::arrow::pyarrow::PyArrowType;
3232
use datafusion::datasource::{TableProvider, TableType};
3333
use datafusion::error::{DataFusionError, Result as DFResult};
34+
use datafusion::logical_expr::Expr;
3435
use datafusion::logical_expr::TableProviderFilterPushDown;
3536
use datafusion::physical_plan::ExecutionPlan;
36-
use datafusion_expr::Expr;
3737

3838
use crate::dataset_exec::DatasetExec;
3939
use crate::pyarrow_filter_expression::PyArrowFilterExpression;

src/dataset_exec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ use datafusion::arrow::pyarrow::PyArrowType;
3232
use datafusion::arrow::record_batch::RecordBatch;
3333
use datafusion::error::{DataFusionError as InnerDataFusionError, Result as DFResult};
3434
use datafusion::execution::context::TaskContext;
35+
use datafusion::logical_expr::utils::conjunction;
36+
use datafusion::logical_expr::Expr;
3537
use datafusion::physical_expr::{EquivalenceProperties, PhysicalSortExpr};
3638
use datafusion::physical_plan::stream::RecordBatchStreamAdapter;
3739
use datafusion::physical_plan::{
3840
DisplayAs, DisplayFormatType, ExecutionMode, ExecutionPlan, ExecutionPlanProperties,
3941
Partitioning, SendableRecordBatchStream, Statistics,
4042
};
41-
use datafusion_expr::utils::conjunction;
42-
use datafusion_expr::Expr;
4343

4444
use crate::errors::DataFusionError;
4545
use crate::pyarrow_filter_expression::PyArrowFilterExpression;

src/expr.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use datafusion_expr::utils::exprlist_to_fields;
19-
use datafusion_expr::{ExprFuncBuilder, ExprFunctionExt, LogicalPlan};
18+
use datafusion::logical_expr::utils::exprlist_to_fields;
19+
use datafusion::logical_expr::{ExprFuncBuilder, ExprFunctionExt, LogicalPlan};
2020
use pyo3::{basic::CompareOp, prelude::*};
2121
use std::convert::{From, Into};
2222
use std::sync::Arc;
@@ -26,12 +26,12 @@ use arrow::pyarrow::ToPyArrow;
2626
use datafusion::arrow::datatypes::{DataType, Field};
2727
use datafusion::arrow::pyarrow::PyArrowType;
2828
use datafusion::functions::core::expr_ext::FieldAccessor;
29-
use datafusion::scalar::ScalarValue;
30-
use datafusion_expr::{
29+
use datafusion::logical_expr::{
3130
col,
3231
expr::{AggregateFunction, InList, InSubquery, ScalarFunction, Sort, WindowFunction},
3332
lit, Between, BinaryExpr, Case, Cast, Expr, Like, Operator, TryCast,
3433
};
34+
use datafusion::scalar::ScalarValue;
3535

3636
use crate::common::data_type::{DataTypeMap, NullTreatment, RexType};
3737
use crate::errors::{py_runtime_err, py_type_err, py_unsupported_variant_err, DataFusionError};

src/expr/aggregate.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use datafusion_common::DataFusionError;
19-
use datafusion_expr::expr::{AggregateFunction, Alias};
20-
use datafusion_expr::logical_plan::Aggregate;
21-
use datafusion_expr::Expr;
18+
use datafusion::common::DataFusionError;
19+
use datafusion::logical_expr::expr::{AggregateFunction, Alias};
20+
use datafusion::logical_expr::logical_plan::Aggregate;
21+
use datafusion::logical_expr::Expr;
2222
use pyo3::prelude::*;
2323
use std::fmt::{self, Display, Formatter};
2424

src/expr/aggregate_expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
use crate::expr::PyExpr;
19-
use datafusion_expr::expr::AggregateFunction;
19+
use datafusion::logical_expr::expr::AggregateFunction;
2020
use pyo3::prelude::*;
2121
use std::fmt::{Display, Formatter};
2222

src/expr/alias.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::expr::PyExpr;
1919
use pyo3::prelude::*;
2020
use std::fmt::{self, Display, Formatter};
2121

22-
use datafusion_expr::expr::Alias;
22+
use datafusion::logical_expr::expr::Alias;
2323

2424
#[pyclass(name = "Alias", module = "datafusion.expr", subclass)]
2525
#[derive(Clone)]

src/expr/analyze.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use datafusion_expr::logical_plan::Analyze;
18+
use datafusion::logical_expr::logical_plan::Analyze;
1919
use pyo3::prelude::*;
2020
use std::fmt::{self, Display, Formatter};
2121

src/expr/between.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
use crate::expr::PyExpr;
19-
use datafusion_expr::expr::Between;
19+
use datafusion::logical_expr::expr::Between;
2020
use pyo3::prelude::*;
2121
use std::fmt::{self, Display, Formatter};
2222

src/expr/binary_expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
use crate::expr::PyExpr;
19-
use datafusion_expr::BinaryExpr;
19+
use datafusion::logical_expr::BinaryExpr;
2020
use pyo3::prelude::*;
2121

2222
#[pyclass(name = "BinaryExpr", module = "datafusion.expr", subclass)]

src/expr/bool_expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use datafusion_expr::Expr;
18+
use datafusion::logical_expr::Expr;
1919
use pyo3::prelude::*;
2020
use std::fmt::{self, Display, Formatter};
2121

src/expr/case.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
use crate::expr::PyExpr;
19-
use datafusion_expr::Case;
19+
use datafusion::logical_expr::Case;
2020
use pyo3::prelude::*;
2121

2222
#[pyclass(name = "Case", module = "datafusion.expr", subclass)]

src/expr/cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
use crate::{common::data_type::PyDataType, expr::PyExpr};
19-
use datafusion_expr::{Cast, TryCast};
19+
use datafusion::logical_expr::{Cast, TryCast};
2020
use pyo3::prelude::*;
2121

2222
#[pyclass(name = "Cast", module = "datafusion.expr", subclass)]

src/expr/column.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use datafusion_common::Column;
18+
use datafusion::common::Column;
1919
use pyo3::prelude::*;
2020

2121
#[pyclass(name = "Column", module = "datafusion.expr", subclass)]

src/expr/conditional_expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
use crate::expr::PyExpr;
19-
use datafusion_expr::conditional_expressions::CaseBuilder;
19+
use datafusion::logical_expr::conditional_expressions::CaseBuilder;
2020
use pyo3::prelude::*;
2121

2222
#[pyclass(name = "CaseBuilder", module = "datafusion.expr", subclass)]

src/expr/create_memory_table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use std::fmt::{self, Display, Formatter};
1919

20-
use datafusion_expr::CreateMemoryTable;
20+
use datafusion::logical_expr::CreateMemoryTable;
2121
use pyo3::prelude::*;
2222

2323
use crate::sql::logical::PyLogicalPlan;

src/expr/create_view.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use std::fmt::{self, Display, Formatter};
1919

20-
use datafusion_expr::{CreateView, DdlStatement, LogicalPlan};
20+
use datafusion::logical_expr::{CreateView, DdlStatement, LogicalPlan};
2121
use pyo3::prelude::*;
2222

2323
use crate::{errors::py_type_err, sql::logical::PyLogicalPlan};

src/expr/cross_join.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
use datafusion_expr::logical_plan::CrossJoin;
18+
use datafusion::logical_expr::logical_plan::CrossJoin;
1919
use pyo3::prelude::*;
2020
use std::fmt::{self, Display, Formatter};
2121

src/expr/distinct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use std::fmt::{self, Display, Formatter};
1919

20-
use datafusion_expr::Distinct;
20+
use datafusion::logical_expr::Distinct;
2121
use pyo3::prelude::*;
2222

2323
use crate::sql::logical::PyLogicalPlan;

src/expr/drop_table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
use std::fmt::{self, Display, Formatter};
1919

20-
use datafusion_expr::logical_plan::DropTable;
20+
use datafusion::logical_expr::logical_plan::DropTable;
2121
use pyo3::prelude::*;
2222

2323
use crate::sql::logical::PyLogicalPlan;

src/expr/empty_relation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
use crate::{common::df_schema::PyDFSchema, sql::logical::PyLogicalPlan};
19-
use datafusion_expr::EmptyRelation;
19+
use datafusion::logical_expr::EmptyRelation;
2020
use pyo3::prelude::*;
2121
use std::fmt::{self, Display, Formatter};
2222

0 commit comments

Comments
 (0)