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: Returns 404 instead of 500 for unknown dashboard filter state keys #17878

Conversation

michael-s-molina
Copy link
Member

SUMMARY

Returns 404 instead of 500 for unknown dashboard filter state keys.

TESTING INSTRUCTIONS

1 - Execute all tests
2 - All tests should pass

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • 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

@codecov
Copy link

codecov bot commented Dec 27, 2021

Codecov Report

Merging #17878 (3e3c7bb) into master (ef57bd1) will decrease coverage by 0.01%.
The diff coverage is 75.00%.

❗ Current head 3e3c7bb differs from pull request most recent head 68e47aa. Consider uploading reports for the commit 68e47aa to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master   #17878      +/-   ##
==========================================
- Coverage   67.09%   67.08%   -0.02%     
==========================================
  Files        1609     1609              
  Lines       64897    64895       -2     
  Branches     6866     6866              
==========================================
- Hits        43545    43533      -12     
- Misses      19486    19496      +10     
  Partials     1866     1866              
Flag Coverage Δ
hive 53.29% <0.00%> (-28.53%) ⬇️
mysql 82.19% <75.00%> (+<0.01%) ⬆️
postgres 82.25% <75.00%> (+<0.01%) ⬆️
presto 53.13% <0.00%> (-28.98%) ⬇️
python 82.69% <75.00%> (-0.04%) ⬇️
sqlite 81.93% <75.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
superset/dashboards/filter_state/commands/get.py 92.30% <75.00%> (+5.64%) ⬆️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/db_engine_specs/hive.py 85.71% <0.00%> (-1.55%) ⬇️
superset/db_engine_specs/presto.py 89.14% <0.00%> (-0.84%) ⬇️
superset/models/core.py 89.51% <0.00%> (-0.49%) ⬇️
superset/connectors/sqla/models.py 88.31% <0.00%> (-0.12%) ⬇️
superset/key_value/api.py 79.51% <0.00%> (+1.20%) ⬆️

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 ef57bd1...68e47aa. Read the comment docs.

@michael-s-molina michael-s-molina force-pushed the fix-unknown-dashboard-filter-state-keys branch from 35c23ef to 030d322 Compare December 29, 2021 14:38
@rusackas
Copy link
Member

rusackas commented Jan 6, 2022

LGTM, but a second pair of eyes wouldn't hurt. Maybe @zhaoyongjie?

Copy link
Member

@zhaoyongjie zhaoyongjie left a comment

Choose a reason for hiding this comment

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

LGTM, a little improvements leave in this function

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 with minor non-blocking comment.

superset/dashboards/filter_state/commands/get.py Outdated Show resolved Hide resolved
michael-s-molina and others added 4 commits January 10, 2022 11:25
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
@michael-s-molina michael-s-molina merged commit 3a9bd12 into apache:master Jan 10, 2022
shcoderAlex pushed a commit to casual-precision/superset that referenced this pull request Feb 7, 2022
…ys (apache#17878)

* fix: Returns 404 instead of 500 for unknown dashboard filter state keys

* Reduces hierarchies of if-expression

* Removes unnecessary check

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>

* Removes unused variable

* Fixes type error

* Removes unused import

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
bwang221 pushed a commit to casual-precision/superset that referenced this pull request Feb 10, 2022
…ys (apache#17878)

* fix: Returns 404 instead of 500 for unknown dashboard filter state keys

* Reduces hierarchies of if-expression

* Removes unnecessary check

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>

* Removes unused variable

* Fixes type error

* Removes unused import

Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.0 labels Mar 13, 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/S 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants