-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
fix: broken IS NULL and IS NOT NULL operator #9613
fix: broken IS NULL and IS NOT NULL operator #9613
Conversation
@@ -883,9 +883,9 @@ def get_sqla_query( # sqla | |||
elif op == utils.FilterOperationType.LIKE.value: | |||
where_clause_and.append(col_obj.get_sqla_col().like(eq)) | |||
elif op == utils.FilterOperationType.IS_NULL.value: | |||
where_clause_and.append(col_obj.get_sqla_col() is None) | |||
where_clause_and.append(col_obj.get_sqla_col() == None) |
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.
is None
and is not None
is preferred
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.
It actually doesn't work in this case (tested), SqlAlchemy expects them to be in this form.
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.
Going to add unit tests.
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.
oh yes I understand!
Codecov Report
@@ Coverage Diff @@
## master #9613 +/- ##
==========================================
+ Coverage 65.65% 70.54% +4.88%
==========================================
Files 574 574
Lines 30131 30131
Branches 3066 3066
==========================================
+ Hits 19782 21255 +1473
+ Misses 10165 8765 -1400
+ Partials 184 111 -73
Continue to review full report at Codecov.
|
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.
LGTM
* fix: broken is null and is not null operator * add unit tests * Rename filter operator enum
CATEGORY
Choose one
SUMMARY
#9556 introduced a regression in the SQLA model which broke the
IS NULL
andIS NOT NULL
operators. This fixes the regression, adds unit tests that would have cought the regression and renames the filter operator enum to something slightly simpler.TEST PLAN
CI + tested locally
ADDITIONAL INFORMATION
REVIEWERS