chore: refactor IsNullOp and NotNullOp logic to make scalar ops generation easier#1822
Merged
chore: refactor IsNullOp and NotNullOp logic to make scalar ops generation easier#1822
Conversation
This change consolidates the definition and compilation logic for IsNullOp, isnull_op, NotNullOp, and notnull_op into a new, dedicated file: `bigframes/operations/isnull_op.py`. Key changes include: - Moved operator definitions from `generic_ops.py` to `isnull_op.py`. - Moved Ibis scalar compilation logic from `scalar_op_compiler.py` to `isnull_op.py`. - Moved Polars expression compilation logic from `polars/compiler.py` to `isnull_op.py`. - Updated main compilers (`ScalarOpCompiler` and `PolarsExpressionCompiler`) to directly import and register the compilation functions from `isnull_op.py`. - Ensured all internal references and naming conventions (`IsNullOp`, `isnull_op`, `NotNullOp`, `notnull_op`) are consistent with the refactored structure. NOTE: I was unable to perform test validation (unit and system) due to missing project-specific dependencies, primarily `bigframes_vendored` and `test_utils.prefixer`. The changes are provided based on the completion of the refactoring steps as you requested.
tswast
commented
Jun 13, 2025
tswast
commented
Jun 13, 2025
tswast
commented
Jun 13, 2025
tswast
commented
Jun 13, 2025
tswast
commented
Jul 8, 2025
Collaborator
Author
There was a problem hiding this comment.
The /io/ in the file path was messing up numpy in local pytest tests/system/small.
tswast
commented
Jul 9, 2025
Comment on lines
44
to
48
| def _ibis_isnull_op_impl(x: ibis_types.Value): | ||
| return x.isnull() | ||
|
|
||
|
|
||
| scalar_op_compiler.scalar_op_compiler.register_unary_op(isnull_op)(_ibis_isnull_op_impl) |
Collaborator
Author
There was a problem hiding this comment.
Discussed offline. Rather than combine this here, splitting up the scalar_op_compiler into multiple files would avoid the inversion and circular import problems.
tswast
commented
Jul 15, 2025
tswast
commented
Aug 6, 2025
TrevorBergeron
previously approved these changes
Aug 6, 2025
tswast
commented
Aug 6, 2025
TrevorBergeron
previously approved these changes
Aug 6, 2025
TrevorBergeron
previously approved these changes
Aug 6, 2025
Collaborator
Author
|
Notebook failure is |
TrevorBergeron
approved these changes
Aug 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change consolidates the definition and compilation logic for IsNullOp, isnull_op, NotNullOp, and notnull_op into a new, dedicated file:
bigframes/operations/isnull_op.py.Key changes include:
generic_ops.pytoisnull_op.py.scalar_op_compiler.pytoisnull_op.py.polars/compiler.pytoisnull_op.py.ScalarOpCompilerandPolarsExpressionCompiler) to directly import and register the compilation functions fromisnull_op.py.IsNullOp,isnull_op,NotNullOp,notnull_op) are consistent with the refactored structure.NOTE: I was unable to perform test validation (unit and system) due to missing project-specific dependencies, primarily
bigframes_vendoredandtest_utils.prefixer. The changes are provided based on the completion of the refactoring steps as you requested.Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕