Uh oh!
There was an error while loading. Please reload this page.
Add missing conditional functions - #1464
Conversation
There was a problem hiding this comment.
Pull request overview
Exposes missing conditional scalar functions in datafusion-python to close #1449, adding Python wrappers/bindings and unit tests.
Changes:
- Add Python API functions:
greatest,least,nvl2, andifnull(alias fornvl). - Add Rust PyO3 bindings for
greatest,least(variadic) andnvl2. - Add unit tests covering numeric/string behavior and null handling.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| python/datafusion/functions.py | Adds new public Python wrappers and updates exports (__all__). |
| crates/core/src/functions.rs | Exposes the corresponding DataFusion functions to Python via PyO3 wrappers. |
| python/tests/test_functions.py | Adds unit tests validating the new functions’ behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
nuno-faria
left a comment
There was a problem hiding this comment.
Thanks @timsaucer. I think df in the new tests can be removed as suggested by copilot.
…che#1449) Expose four conditional functions from upstream DataFusion that were not yet available in the Python bindings. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests cover multiple data types (integers, strings), null handling (all-null, partial-null), multiple arguments, and ifnull/nvl equivalence. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace separate test functions for coalesce, greatest, least, nvl, nvl2, ifnull with a single parametrized test using a shared fixture. Adds coverage for nvl, nullif (previously untested), datetime and boolean types, literal fallbacks, and variadic calls. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c773349 to
835f91fCompareUh oh!
There was an error while loading. Please reload this page.
Which issue does this PR close?
Closes#1449
Rationale for this change
There are a few methods missing from the Python library, so this exposes them.
What changes are included in this PR?
Exposes python functions.
Adds unit tests.
Are there any user-facing changes?
Addition only.