Skip to content

Commit 04e65e8

Browse files
committed
change more instances of PyExpr > PySortExpr
1 parent 6a7dc07 commit 04e65e8

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/expr/sort.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use std::fmt::{self, Display, Formatter};
2222

2323
use crate::common::df_schema::PyDFSchema;
2424
use crate::expr::logical_node::LogicalNode;
25-
use crate::expr::PyExpr;
25+
use crate::expr::sort_expr::PySortExpr;
2626
use crate::sql::logical::PyLogicalPlan;
2727

2828
#[pyclass(name = "Sort", module = "datafusion.expr", subclass)]
@@ -63,12 +63,12 @@ impl Display for PySort {
6363
#[pymethods]
6464
impl PySort {
6565
/// Retrieves the sort expressions for this `Sort`
66-
fn sort_exprs(&self) -> PyResult<Vec<PyExpr>> {
66+
fn sort_exprs(&self) -> PyResult<Vec<PySortExpr>> {
6767
Ok(self
6868
.sort
6969
.expr
7070
.iter()
71-
.map(|e| PyExpr::from(e.clone()))
71+
.map(|e| PySortExpr::from(e.clone()))
7272
.collect())
7373
}
7474

src/expr/sort_expr.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ pub fn to_sort_expressions(order_by: Vec<PySortExpr>) -> Vec<SortExpr> {
5858
.collect()
5959
}
6060

61+
pub fn py_sort_expr_list(expr: &[SortExpr]) -> PyResult<Vec<PySortExpr>> {
62+
Ok(expr.iter().map(|e| PySortExpr::from(e.clone())).collect())
63+
}
64+
6165
#[pymethods]
6266
impl PySortExpr {
6367
fn expr(&self) -> PyResult<PyExpr> {

0 commit comments

Comments
 (0)