BharatDeva opened a new pull request, #1643: URL: https://github.com/apache/datafusion-python/pull/1643
Closes #1235 # Rationale for this change The Python API currently exposes `is_null()` with snake_case naming, but the NaN check is only available as `isnan()`. Adding `is_nan()` gives users a casing-consistent spelling while preserving the existing `isnan()` API. # What changes are included in this PR? This adds `datafusion.functions.is_nan(...)` as an alias for `isnan(...)` and adds `Expr.is_nan()` as the corresponding expression method. Existing `isnan()` 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(...))` and `col(...).is_nan()` in addition to the existing `isnan` spelling. This is additive and does not remove or deprecate the current API. # Testing ```bash uvx pre-commit run --files python/datafusion/functions/__init__.py python/datafusion/expr.py python/tests/test_functions.py python/tests/test_expr.py ``` Result: passed. I also ran a WSL canary against the published `datafusion==54.0.0` wheel with the modified wrapper files overlaid: ```text is_nan aliases match isnan output: [False, True, None] ``` Note: a full Windows `uv run pytest` is blocked on this machine because building `nanoarrow==0.8.0` requires a local C/C++ compiler. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
