Skip to content

Commit

Permalink
migrate from function-array to functions-nested
Browse files Browse the repository at this point in the history
The package was renamed upstream.

Ref: apache/datafusion#11602
  • Loading branch information
Michael-J-Ward committed Aug 20, 2024
1 parent b077df9 commit 424a3fa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ arrow = { version = "52", feature = ["pyarrow"] }
datafusion = { git = "https://github.com/apache/datafusion.git", features = ["pyarrow", "avro", "unicode_expressions"] }
datafusion-common = { git = "https://github.com/apache/datafusion.git", features = ["pyarrow"] }
datafusion-expr = { git = "https://github.com/apache/datafusion.git" }
datafusion-functions-array = { git = "https://github.com/apache/datafusion.git", package = "datafusion-functions-nested" }
datafusion-functions-nested = { git = "https://github.com/apache/datafusion.git" }
# TODO: is this just re-exported?
datafusion-optimizer = { git = "https://github.com/apache/datafusion.git" }
# TODO: is this just re-exported?
datafusion-sql = { git = "https://github.com/apache/datafusion.git" }
datafusion-substrait = { git = "https://github.com/apache/datafusion.git", optional = true }
prost = "0.12" # keep in line with `datafusion-substrait`
Expand Down
12 changes: 6 additions & 6 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,14 @@ fn in_list(expr: PyExpr, value: Vec<PyExpr>, negated: bool) -> PyExpr {

#[pyfunction]
fn make_array(exprs: Vec<PyExpr>) -> PyExpr {
datafusion_functions_array::expr_fn::make_array(exprs.into_iter().map(|x| x.into()).collect())
datafusion_functions_nested::expr_fn::make_array(exprs.into_iter().map(|x| x.into()).collect())
.into()
}

#[pyfunction]
fn array_concat(exprs: Vec<PyExpr>) -> PyExpr {
let exprs = exprs.into_iter().map(|x| x.into()).collect();
datafusion_functions_array::expr_fn::array_concat(exprs).into()
datafusion_functions_nested::expr_fn::array_concat(exprs).into()
}

#[pyfunction]
Expand All @@ -407,12 +407,12 @@ fn array_cat(exprs: Vec<PyExpr>) -> PyExpr {
fn array_position(array: PyExpr, element: PyExpr, index: Option<i64>) -> PyExpr {
let index = ScalarValue::Int64(index);
let index = Expr::Literal(index);
datafusion_functions_array::expr_fn::array_position(array.into(), element.into(), index).into()
datafusion_functions_nested::expr_fn::array_position(array.into(), element.into(), index).into()
}

#[pyfunction]
fn array_slice(array: PyExpr, begin: PyExpr, end: PyExpr, stride: Option<PyExpr>) -> PyExpr {
datafusion_functions_array::expr_fn::array_slice(
datafusion_functions_nested::expr_fn::array_slice(
array.into(),
begin.into(),
end.into(),
Expand Down Expand Up @@ -695,7 +695,7 @@ macro_rules! expr_fn_vec {
};
}

/// Generates a [pyo3] wrapper for [datafusion_functions_array::expr_fn]
/// Generates a [pyo3] wrapper for [datafusion_functions_nested::expr_fn]
///
/// These functions have explicit named arguments.
macro_rules! array_fn {
Expand All @@ -712,7 +712,7 @@ macro_rules! array_fn {
#[doc = $DOC]
#[pyfunction]
fn $FUNC($($arg: PyExpr),*) -> PyExpr {
datafusion_functions_array::expr_fn::$FUNC($($arg.into()),*).into()
datafusion_functions_nested::expr_fn::$FUNC($($arg.into()),*).into()
}
};
}
Expand Down

0 comments on commit 424a3fa

Please sign in to comment.