-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: dataframe function count_all with alias #17282
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
Conversation
@kosiew pls review |
LGTM. note: This is a re-implementation of #17253 |
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.
Thanks @Loaki07 for working on this.
// Unwrap all alias layers to get to the underlying aggregate function | ||
let (name, human_display, e) = match e { | ||
Expr::Alias(Alias { expr, name, .. }) => { | ||
(Some(name.clone()), String::default(), expr.as_ref()) | ||
Expr::Alias(Alias { name, .. }) => { | ||
let unaliased = e.clone().unalias_nested().data; | ||
( | ||
Some(name.clone()), | ||
e.human_display().to_string(), | ||
unaliased.clone(), | ||
) | ||
} |
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.
Follow up action:
This is useful to be extracted to a helper function eg
Expr::unwrap_alias.
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.
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.
Which issue does this PR close?
Closes #.
count_all() aggregations cannot be aliased #16795
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Yes
Are there any user-facing changes?