-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Python bindings for window functions #819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python bindings for window functions #819
Conversation
|
There is some pending issues:
|
|
cc @jimexist |
python/src/dataframe.rs
Outdated
| // sort by sort_key len descending, so that more deeply sorted plans gets nested further | ||
| // down as children; to further mimic the behavior of PostgreSQL, we want stable sort | ||
| // and a reverse so that tieing sort keys are reversed in order; note that by this rule | ||
| // if there's an empty over, it'll be at the top level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wonder if there can be a way to reuse this part of the code
|
FYI #1167 added some support in DataFrame API |
749e5f7 to
0057285
Compare
0057285 to
f99e9c8
Compare
|
hi @jgoday do you mind rebasing first? |
6993939 to
2cf2694
Compare
2cf2694 to
d24b886
Compare
|
Hi @jimexist, rebasing done. |
| #[pyfunction] | ||
| fn alias(expr: PyExpr, name: &str) -> PyResult<PyExpr> { | ||
| Ok(PyExpr { | ||
| expr: datafusion::logical_plan::Expr::Alias( | ||
| Box::new(expr.expr), | ||
| String::from(name), | ||
| ), | ||
| }) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you think alias should be a method on the expression or column object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expression already has an alias method, but perhaps we can support both APIs.
jimexist
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 😎🤘
…ache#819) * new benchmark * remove assertion from average agg, add stddev microbenchmark * disable stddev by default * format
Which issue does this PR close?
Closes #572.
Rationale for this change
Allows to use window functions from python bindings (inside a select expression).
What changes are included in this PR?
Are there any user-facing changes?
Changes to python crate, new exported functions (sort_by, alias and window).