Skip to content

Improved window and aggregate function signature #1187

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

timsaucer
Copy link
Contributor

Which issue does this PR close?

None

Rationale for this change

This is a relatively minor change that allows users to pass a single expression for order_by and partition_by fields.

Without this change, if used improperly planning gets stuck in a loop. This improves ergonomics.

Old version required:

df.select(f.lag(column("a"), order_by=[column("b")])

and now you can also write

df.select(f.lag(column("a"), order_by=column("b"))

What changes are included in this PR?

Enhances the check to see if we pass a single expression. When this is true, wrap it in a list. Added unit tests.

Are there any user-facing changes?

This is a non-breaking signature change. It is backwards compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant