Skip to content

Conversation

timsaucer
Copy link
Member

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.

@timsaucer timsaucer merged commit 5892585 into apache:main Aug 21, 2025
17 checks passed
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