-
Notifications
You must be signed in to change notification settings - Fork 52
chore: refactor IsNullOp and NotNullOp logic to make scalar ops generation easier #1822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The /io/
in the file path was messing up numpy
in local pytest tests/system/small
.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed offline. Rather than combine this here, splitting up the scalar_op_compiler
into multiple files would avoid the inversion and circular import problems.
Notebook failure is |
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.py
toisnull_op.py
.scalar_op_compiler.py
toisnull_op.py
.polars/compiler.py
toisnull_op.py
.ScalarOpCompiler
andPolarsExpressionCompiler
) 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_vendored
andtest_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> 🦕