Skip to content

Conversation

NickCrews
Copy link
Contributor

@NickCrews NickCrews commented Jun 6, 2025

Before, t.mutate(t.x.first(ignore_nulls=True).over(group_by=y)) would behave the same as t.mutate(t.x.first(ignore_nulls=False).over(group_by=y)). Now they behave differently for some backends.

I discovered this when implementing #11308

I am seeing what CI says before updating the tests/implementation for the other backends

@github-actions github-actions bot added tests Issues or PRs related to tests sql Backends that generate SQL labels Jun 6, 2025
NickCrews added a commit to NickCrews/ibis that referenced this pull request Jun 6, 2025
Do not replace first() with first_value() because, per
https://duckdb.org/docs/stable/sql/functions/window_functions#aggregate-window-functions
The first and last aggregate functions are shadowed by the respective
general-purpose window functions, with the minor consequence that the
FILTER clause is not available for these but IGNORE NULLS is.

After this change, the generated SQL is more canonical, and include_null actually works.

This probably should wait until ibis-project#11311 lands, which has the tests for this change.
@NickCrews NickCrews marked this pull request as draft June 6, 2025 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql Backends that generate SQL tests Issues or PRs related to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant