Skip to content

Commit

Permalink
clean up functions_window invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-J-Ward committed Oct 28, 2024
1 parent 00aba9f commit d86520b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// under the License.

use datafusion::functions_aggregate::all_default_aggregate_functions;
use datafusion::logical_expr::window_function;
use datafusion::logical_expr::ExprFunctionExt;
use datafusion::logical_expr::WindowFrame;
use pyo3::{prelude::*, wrap_pyfunction};
Expand All @@ -33,6 +32,7 @@ use datafusion::common::{Column, ScalarValue, TableReference};
use datafusion::execution::FunctionRegistry;
use datafusion::functions;
use datafusion::functions_aggregate;
use datafusion::functions_window;
use datafusion::logical_expr::expr::Alias;
use datafusion::logical_expr::sqlparser::ast::NullTreatment as DFNullTreatment;
use datafusion::logical_expr::{
Expand Down Expand Up @@ -757,7 +757,7 @@ pub fn lead(
partition_by: Option<Vec<PyExpr>>,
order_by: Option<Vec<PySortExpr>>,
) -> PyResult<PyExpr> {
let window_fn = datafusion::functions_window::expr_fn::lead(arg.expr, Some(shift_offset), default_value);
let window_fn = functions_window::expr_fn::lead(arg.expr, Some(shift_offset), default_value);

add_builder_fns_to_window(window_fn, partition_by, None, order_by, None)
}
Expand All @@ -771,7 +771,7 @@ pub fn lag(
partition_by: Option<Vec<PyExpr>>,
order_by: Option<Vec<PySortExpr>>,
) -> PyResult<PyExpr> {
let window_fn = datafusion::functions_window::expr_fn::lag(arg.expr, Some(shift_offset), default_value);
let window_fn = functions_window::expr_fn::lag(arg.expr, Some(shift_offset), default_value);

add_builder_fns_to_window(window_fn, partition_by, None, order_by, None)
}
Expand All @@ -782,7 +782,7 @@ pub fn row_number(
partition_by: Option<Vec<PyExpr>>,
order_by: Option<Vec<PySortExpr>>,
) -> PyResult<PyExpr> {
let window_fn = datafusion::functions_window::expr_fn::row_number();
let window_fn = functions_window::expr_fn::row_number();

add_builder_fns_to_window(window_fn, partition_by, None, order_by, None)
}
Expand All @@ -793,7 +793,7 @@ pub fn rank(
partition_by: Option<Vec<PyExpr>>,
order_by: Option<Vec<PySortExpr>>,
) -> PyResult<PyExpr> {
let window_fn = datafusion::functions_window::expr_fn::rank();
let window_fn = functions_window::expr_fn::rank();

add_builder_fns_to_window(window_fn, partition_by, None, order_by, None)
}
Expand All @@ -804,7 +804,7 @@ pub fn dense_rank(
partition_by: Option<Vec<PyExpr>>,
order_by: Option<Vec<PySortExpr>>,
) -> PyResult<PyExpr> {
let window_fn = datafusion::functions_window::expr_fn::dense_rank();
let window_fn = functions_window::expr_fn::dense_rank();

add_builder_fns_to_window(window_fn, partition_by, None, order_by, None)
}
Expand All @@ -815,7 +815,7 @@ pub fn percent_rank(
partition_by: Option<Vec<PyExpr>>,
order_by: Option<Vec<PySortExpr>>,
) -> PyResult<PyExpr> {
let window_fn = datafusion::functions_window::expr_fn::percent_rank();
let window_fn = functions_window::expr_fn::percent_rank();

add_builder_fns_to_window(window_fn, partition_by, None, order_by, None)
}
Expand All @@ -826,7 +826,7 @@ pub fn cume_dist(
partition_by: Option<Vec<PyExpr>>,
order_by: Option<Vec<PySortExpr>>,
) -> PyResult<PyExpr> {
let window_fn = datafusion::functions_window::expr_fn::cume_dist();
let window_fn = functions_window::expr_fn::cume_dist();

add_builder_fns_to_window(window_fn, partition_by, None, order_by, None)
}
Expand All @@ -838,7 +838,7 @@ pub fn ntile(
partition_by: Option<Vec<PyExpr>>,
order_by: Option<Vec<PySortExpr>>,
) -> PyResult<PyExpr> {
let window_fn = datafusion::functions_window::expr_fn::ntile(arg.into());
let window_fn = functions_window::expr_fn::ntile(arg.into());

add_builder_fns_to_window(window_fn, partition_by, None, order_by, None)
}
Expand Down

0 comments on commit d86520b

Please sign in to comment.