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

feat(native-filters): add null option to value filter #15419

Merged
merged 6 commits into from
Jul 1, 2021
Merged

feat(native-filters): add null option to value filter #15419

merged 6 commits into from
Jul 1, 2021

Conversation

mironovmeow
Copy link
Contributor

SUMMARY

This PR add option of "null" for the select filter in the Dashboard's Native Filter.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshot_2021-06-25_17-52-38
Screenshot_2021-06-25_17-53-18

TESTING INSTRUCTIONS

  1. Set "DASHBOARD_NATIVE_FILTERS": True in superset/config.py
  2. Open Dashboard with null var in DB (I use "Video Game Sales")
  3. Open Dashboard Native Filter with column publisher

ADDITIONAL INFORMATION

  • Has associated issue: Fixes Dashboard Native Filter: cannot filter null values #15291
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

Thanks alot for this improvement! I didn't know that SqlAlchemy does an on-the-fly OR statement when mixing NULLs and actual values in IN clauses:
image. This needs some linter fixing + I would appreciate a few unit tests. Please ping me on Slack if you need help, would love to get this in asap!

@villebro villebro changed the title fix: add null var to native filter (#15291) feat(native-filters): add null option to value filter Jun 30, 2021
@villebro villebro added the v1.3 label Jun 30, 2021
Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Jul 1, 2021

Codecov Report

Merging #15419 (8382b3d) into master (f53b2c6) will decrease coverage by 0.25%.
The diff coverage is 63.17%.

❗ Current head 8382b3d differs from pull request most recent head fc730e1. Consider uploading reports for the commit fc730e1 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15419      +/-   ##
==========================================
- Coverage   77.22%   76.97%   -0.26%     
==========================================
  Files         975      974       -1     
  Lines       50634    50816     +182     
  Branches     6222     6727     +505     
==========================================
+ Hits        39104    39117      +13     
- Misses      11319    11484     +165     
- Partials      211      215       +4     
Flag Coverage Δ
hive ?
javascript 71.77% <66.97%> (+0.02%) ⬆️
presto ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...erset-frontend/src/components/AnchorLink/index.jsx 95.83% <ø> (ø)
...rset-frontend/src/components/ErrorMessage/types.ts 100.00% <ø> (ø)
...src/components/FilterableTable/FilterableTable.tsx 82.26% <ø> (ø)
superset-frontend/src/components/Select/Select.tsx 0.00% <0.00%> (ø)
superset-frontend/src/constants.ts 100.00% <ø> (ø)
superset-frontend/src/dashboard/actions/hydrate.js 1.72% <ø> (ø)
...frontend/src/dashboard/components/Header/index.jsx 67.15% <ø> (ø)
...dashboard/components/SliceHeaderControls/index.tsx 76.98% <ø> (ø)
...c/dashboard/components/gridComponents/Markdown.jsx 82.82% <ø> (ø)
...d/src/dashboard/components/gridComponents/index.js 100.00% <ø> (ø)
... and 56 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 f53b2c6...fc730e1. Read the comment docs.

@amitmiran137 amitmiran137 merged commit 665459f into apache:master Jul 1, 2021
amitmiran137 pushed a commit that referenced this pull request Jul 4, 2021
* fix: add null var to native filter (#15291)

* small fix

* refactoring code

* restructure the JS code

* update testcase

(cherry picked from commit 665459f)
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
* fix: add null var to native filter (apache#15291)

* small fix

* refactoring code

* restructure the JS code

* update testcase
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
* fix: add null var to native filter (apache#15291)

* small fix

* refactoring code

* restructure the JS code

* update testcase
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
* fix: add null var to native filter (apache#15291)

* small fix

* refactoring code

* restructure the JS code

* update testcase
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 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/M v1.3 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dashboard Native Filter: cannot filter null values
4 participants