Skip to content

Conversation

NickCrews
Copy link
Contributor

@NickCrews NickCrews commented Oct 17, 2025

This is breaking.

Before, doing t.fill_null("a") filled with the string literal "a". Now it tries to bind against a column "a".

It also was impossible to use column references such as t.fill_null(t.other_col) or t.fill_null(ibis._.other_col). Now, it is consistent with how .select(), .mutate(), etc all work, and those two examples work.

This also changes the behavior of the polars backend. Before, Table.fill_null() would fill in NaN. Now it does not, consistent with other backends, and the rest of ibis's Column.fill_null() semantics, including how polars treats Column.fill_null()

This does mean there is now some inconsistency between Table.fill_null() and Value.fill_null(). Value.fill_null("a") interprets the "a" as a literal value, not a column reference. We could adjust that API as well, or at least add a very visible warning to both docstrings. But then what does that mean for the other Value APIs, like Value.isin(["a"])? Is "a" a literal or column reference? Maybe the difference is if the method is on a Table, all strings are treated as column references, but on Values they are treated as literals. To be even more breaking, but what I think would be the most consistent, would be if we made "a" ALWAYS be a literal, and you HAVE to use _.a to reference a column. This would be super breaking, but we could probably provide a decent upgrade path by using a heuristic of is "a" a column in the table? to give warnings for several ibis versions.

As a non-public-facing refactor, this also simplifies the internal representation so that the ops.FillNull always stores a Mapping[str, <bound ops.Value>]

@github-actions github-actions bot added tests Issues or PRs related to tests sql Backends that generate SQL polars The polars backend labels Oct 17, 2025
@NickCrews NickCrews force-pushed the consistent-fill_null branch from 56e7f4a to 20997c8 Compare October 17, 2025 06:52
…, etc

This is breaking.

Before, doing `t.fill_null("a")` filled with the string literal "a".
It also was impossible to use column references such as
`t.fill_null(t.other_col)` or `t.fill_null(ibis._.other_col)`.
Now, it is consistent with how .select(), .mutate(), etc all work.

This also simplifies the internal representation so that the ops.FillNull always stores a `Mapping[str, <bound ops.Value>]`

This also changes the behavior of the polars backend.
Before, Table.fill_null() would fill in NaN.
Now it does not, consistent with other backends,
and the rest of ibis's Column.fill_null() semantics,
including how polars treats Column.fill_null()
@NickCrews NickCrews force-pushed the consistent-fill_null branch from 20997c8 to d5b6c2f Compare October 17, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

polars The polars backend 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