Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Commit 26cb5fb

Browse files
authored
apply cargo fmt (#12)
1 parent 7c1035c commit 26cb5fb

File tree

3 files changed

+10
-20
lines changed

3 files changed

+10
-20
lines changed

src/context.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ impl PyExecutionContext {
6060
Ok(PyDataFrame::new(df))
6161
}
6262

63-
fn create_dataframe(
64-
&mut self,
65-
partitions: Vec<Vec<RecordBatch>>,
66-
) -> PyResult<PyDataFrame> {
63+
fn create_dataframe(&mut self, partitions: Vec<Vec<RecordBatch>>) -> PyResult<PyDataFrame> {
6764
let table = MemTable::try_new(partitions[0][0].schema(), partitions)
6865
.map_err(DataFusionError::from)?;
6966

src/functions.rs

+8-13
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ use pyo3::{prelude::*, wrap_pyfunction};
1919

2020
use datafusion::logical_plan;
2121

22-
use datafusion::physical_plan::{
23-
aggregates::AggregateFunction, functions::BuiltinScalarFunction,
24-
};
22+
use datafusion::physical_plan::{aggregates::AggregateFunction, functions::BuiltinScalarFunction};
2523

2624
use crate::errors;
2725
use crate::expression::PyExpr;
@@ -88,11 +86,7 @@ fn concat_ws(sep: String, args: Vec<PyExpr>) -> PyResult<PyExpr> {
8886

8987
/// Creates a new Sort expression
9088
#[pyfunction]
91-
fn order_by(
92-
expr: PyExpr,
93-
asc: Option<bool>,
94-
nulls_first: Option<bool>,
95-
) -> PyResult<PyExpr> {
89+
fn order_by(expr: PyExpr, asc: Option<bool>, nulls_first: Option<bool>) -> PyResult<PyExpr> {
9690
Ok(PyExpr {
9791
expr: datafusion::logical_plan::Expr::Sort {
9892
expr: Box::new(expr.expr),
@@ -106,10 +100,7 @@ fn order_by(
106100
#[pyfunction]
107101
fn alias(expr: PyExpr, name: &str) -> PyResult<PyExpr> {
108102
Ok(PyExpr {
109-
expr: datafusion::logical_plan::Expr::Alias(
110-
Box::new(expr.expr),
111-
String::from(name),
112-
),
103+
expr: datafusion::logical_plan::Expr::Alias(Box::new(expr.expr), String::from(name)),
113104
})
114105
}
115106

@@ -244,7 +235,11 @@ scalar_function!(sha384, SHA384);
244235
scalar_function!(sha512, SHA512);
245236
scalar_function!(signum, Signum);
246237
scalar_function!(sin, Sin);
247-
scalar_function!(split_part, SplitPart, "Splits string at occurrences of delimiter and returns the n'th field (counting from one).");
238+
scalar_function!(
239+
split_part,
240+
SplitPart,
241+
"Splits string at occurrences of delimiter and returns the n'th field (counting from one)."
242+
);
248243
scalar_function!(sqrt, Sqrt);
249244
scalar_function!(
250245
starts_with,

src/udf.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ use datafusion::arrow::datatypes::DataType;
2424
use datafusion::arrow::pyarrow::PyArrowConvert;
2525
use datafusion::error::DataFusionError;
2626
use datafusion::logical_plan;
27-
use datafusion::physical_plan::functions::{
28-
make_scalar_function, ScalarFunctionImplementation,
29-
};
27+
use datafusion::physical_plan::functions::{make_scalar_function, ScalarFunctionImplementation};
3028
use datafusion::physical_plan::udf::ScalarUDF;
3129

3230
use crate::expression::PyExpr;

0 commit comments

Comments
 (0)