Skip to content
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

Merged
merged 3 commits into from Apr 22, 2020

Conversation

villebro
Copy link
Member

@villebro villebro commented Apr 22, 2020

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

#9556 introduced a regression in the SQLA model which broke the IS NULL and IS 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

  • Has associated issue:
  • Changes UI
  • Requires DB Migration.
  • Confirm DB Migration upgrade and downgrade tested.
  • Introduces new feature or API
  • Removes existing feature or API

REVIEWERS

@@ -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)
Copy link
Member

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

Copy link
Member Author

@villebro villebro Apr 22, 2020

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.

Copy link
Member Author

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.

Copy link
Member

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-io
Copy link

codecov-io commented Apr 22, 2020

Codecov Report

Merging #9613 into master will increase coverage by 4.88%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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     
Flag Coverage Δ
#cypress 53.71% <ø> (?)
#javascript 58.76% <ø> (ø)
#python 70.59% <100.00%> (+0.09%) ⬆️
Impacted Files Coverage Δ
superset/connectors/sqla/models.py 88.53% <100.00%> (+2.44%) ⬆️
...rontend/src/SqlLab/components/AceEditorWrapper.tsx 56.98% <0.00%> (+1.07%) ⬆️
superset-frontend/src/components/EditableTitle.jsx 81.69% <0.00%> (+1.40%) ⬆️
...perset-frontend/src/components/CopyToClipboard.jsx 36.36% <0.00%> (+1.51%) ⬆️
...hboard/components/resizable/ResizableContainer.jsx 71.87% <0.00%> (+1.56%) ⬆️
...ashboard/components/gridComponents/ChartHolder.jsx 81.35% <0.00%> (+1.69%) ⬆️
superset-frontend/src/utils/common.js 69.64% <0.00%> (+1.78%) ⬆️
...src/explore/components/controls/VizTypeControl.jsx 78.84% <0.00%> (+1.92%) ⬆️
...rset-frontend/src/explore/components/SaveModal.jsx 94.73% <0.00%> (+2.10%) ⬆️
... and 135 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dcbffed...fe4838d. Read the comment docs.

Copy link
Member

@dpgaspar dpgaspar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@villebro villebro merged commit 85778f5 into apache:master Apr 22, 2020
etr2460 pushed a commit to airbnb/superset-fork that referenced this pull request Apr 24, 2020
* fix: broken is null and is not null operator

* add unit tests

* Rename filter operator enum
@villebro villebro deleted the villebro/fix-deckgl-operator branch April 25, 2020 07:49
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.37.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 0.37.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants