diff --git a/src/context.rs b/src/context.rs index 7f386ba..532a0e4 100644 --- a/src/context.rs +++ b/src/context.rs @@ -60,10 +60,7 @@ impl PyExecutionContext { Ok(PyDataFrame::new(df)) } - fn create_dataframe( - &mut self, - partitions: Vec>, - ) -> PyResult { + fn create_dataframe(&mut self, partitions: Vec>) -> PyResult { let table = MemTable::try_new(partitions[0][0].schema(), partitions) .map_err(DataFusionError::from)?; diff --git a/src/functions.rs b/src/functions.rs index c0b4e59..6cada8b 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -19,9 +19,7 @@ use pyo3::{prelude::*, wrap_pyfunction}; use datafusion::logical_plan; -use datafusion::physical_plan::{ - aggregates::AggregateFunction, functions::BuiltinScalarFunction, -}; +use datafusion::physical_plan::{aggregates::AggregateFunction, functions::BuiltinScalarFunction}; use crate::errors; use crate::expression::PyExpr; @@ -88,11 +86,7 @@ fn concat_ws(sep: String, args: Vec) -> PyResult { /// Creates a new Sort expression #[pyfunction] -fn order_by( - expr: PyExpr, - asc: Option, - nulls_first: Option, -) -> PyResult { +fn order_by(expr: PyExpr, asc: Option, nulls_first: Option) -> PyResult { Ok(PyExpr { expr: datafusion::logical_plan::Expr::Sort { expr: Box::new(expr.expr), @@ -106,10 +100,7 @@ fn order_by( #[pyfunction] fn alias(expr: PyExpr, name: &str) -> PyResult { Ok(PyExpr { - expr: datafusion::logical_plan::Expr::Alias( - Box::new(expr.expr), - String::from(name), - ), + expr: datafusion::logical_plan::Expr::Alias(Box::new(expr.expr), String::from(name)), }) } @@ -244,7 +235,11 @@ scalar_function!(sha384, SHA384); scalar_function!(sha512, SHA512); scalar_function!(signum, Signum); scalar_function!(sin, Sin); -scalar_function!(split_part, SplitPart, "Splits string at occurrences of delimiter and returns the n'th field (counting from one)."); +scalar_function!( + split_part, + SplitPart, + "Splits string at occurrences of delimiter and returns the n'th field (counting from one)." +); scalar_function!(sqrt, Sqrt); scalar_function!( starts_with, diff --git a/src/udf.rs b/src/udf.rs index 379c449..bfc7e9c 100644 --- a/src/udf.rs +++ b/src/udf.rs @@ -24,9 +24,7 @@ use datafusion::arrow::datatypes::DataType; use datafusion::arrow::pyarrow::PyArrowConvert; use datafusion::error::DataFusionError; use datafusion::logical_plan; -use datafusion::physical_plan::functions::{ - make_scalar_function, ScalarFunctionImplementation, -}; +use datafusion::physical_plan::functions::{make_scalar_function, ScalarFunctionImplementation}; use datafusion::physical_plan::udf::ScalarUDF; use crate::expression::PyExpr;