Uh oh!
There was an error while loading. Please reload this page.
Add is_nan aliases - #1643
Conversation
There was a problem hiding this comment.
@BharatDeva
Thanks for working on this!
I took a look and did not find any blocking issues. I have one small suggestion that could make the generated documentation a little clearer.
| return Expr(f.isnan(expr.expr)) | ||
| def is_nan(expr: Expr) -> Expr: |
There was a problem hiding this comment.
Nice addition! Since is_nan is a direct alias of isnan, it might be helpful to make that relationship a little more obvious in the docstring. A short See Also reference to isnan, or reusing the existing isnan example, would make the generated help a bit easier to navigate.
There was a problem hiding this comment.
Thanks for the suggestion. I updated the is_nan docstring to call out that it is an alias for isnan.
Uh oh!
There was an error while loading. Please reload this page.
kosiew
commented
Aug 3, 2026
Thanks for your contribution |
Closes#1235
Rationale for this change
The Python API currently exposes
is_null()with snake_case naming, but the NaN check is only available asisnan(). Addingis_nan()gives users a casing-consistent spelling while preserving the existingisnan()API.What changes are included in this PR?
This adds
datafusion.functions.is_nan(...)as an alias forisnan(...)and addsExpr.is_nan()as the corresponding expression method. Existingisnan()behavior is unchanged.The PR also adds coverage for both the function-level alias and the expression method.
Are there any user-facing changes?
Yes. Users can now call
functions.is_nan(col(...))andcol(...).is_nan()in addition to the existingisnanspelling. This is additive and does not remove or deprecate the current API.Testing
Result: passed.
I also ran a WSL canary against the published
datafusion==54.0.0wheel with the modified wrapper files overlaid:Note: a full Windows
uv run pytestis blocked on this machine because buildingnanoarrow==0.8.0requires a local C/C++ compiler.