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(superset): Fixed API for bulk delete of embedded dashboards #21911

Merged
merged 5 commits into from
Oct 22, 2022

Conversation

sinhashubham95
Copy link
Contributor

@sinhashubham95 sinhashubham95 commented Oct 21, 2022

SUMMARY

This change fixes bulk delete of dashboards which have embedding enabled.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

NA

TESTING INSTRUCTIONS

curl $'http://localhost:8088/api/v1/dashboard/?q=\u0021(id1,id2)' \ -X 'DELETE' \ -H 'Accept: application/json' \ -H 'Cookie: session=some-session' \ -H 'Origin: http://localhost:8088' \ -H 'X-CSRFToken: some-token' \ --compressed

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 Oct 21, 2022

Codecov Report

Merging #21911 (88172e2) into master (04b017e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master   #21911   +/-   ##
=======================================
  Coverage   66.91%   66.91%           
=======================================
  Files        1807     1807           
  Lines       69139    69140    +1     
  Branches     7392     7392           
=======================================
+ Hits        46266    46267    +1     
  Misses      20963    20963           
  Partials     1910     1910           
Flag Coverage Δ
hive 52.92% <0.00%> (-0.01%) ⬇️
mysql 78.35% <100.00%> (+<0.01%) ⬆️
postgres 78.41% <100.00%> (+<0.01%) ⬆️
presto 52.82% <0.00%> (-0.01%) ⬇️
python 81.47% <100.00%> (+<0.01%) ⬆️
sqlite 76.90% <100.00%> (+<0.01%) ⬆️
unit 51.07% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
superset/dashboards/dao.py 96.37% <100.00%> (+0.02%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sinhashubham95
Copy link
Contributor Author

@villebro can you please check this?

@sinhashubham95
Copy link
Contributor Author

@lilykuang @michael-s-molina can you please check this?

@sinhashubham95
Copy link
Contributor Author

@villebro @lilykuang @michael-s-molina can you please check this?

@villebro
Copy link
Member

FYI @sinhashubham95 I restarted the cypress test on CI, will review now

@sinhashubham95
Copy link
Contributor Author

Thanks @villebro

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.

The functional change LGTM with a minor nit on the test. However, I wasn't able to make the test fail by removing the functional change. Can you double check that the test is accurately testing the fix?

tests/integration_tests/dashboards/api_tests.py Outdated Show resolved Hide resolved
@sinhashubham95
Copy link
Contributor Author

@villebro I have refactored the test case as per your suggestion. Also, I verified the test case failing for me without the change when I was running from my local.

@villebro
Copy link
Member

@villebro I have refactored the test case as per your suggestion. Also, I verified the test case failing for me without the change when I was running from my local.

@sinhashubham95 can you post the failing test output without the functional changes? I'm still not able to reproduce the test failure without the functional change. What I did to run the tests locally:

tox -e sqlite tests/integration_tests/dashboards/api_tests.py

Btw, I'm getting an unrelated test failure when running the tests locally and I don't fully understand how that test (test_gets_not_certified_dashboards_filter) is passing on CI (the test seems wrong), but I can look into that, as it's unrelated.

@sinhashubham95
Copy link
Contributor Author

@villebro just to specify this part of the test case failing without this change, I removed the change keeping the test case. Check these job run failures - MYSQL and Postgres.

@sinhashubham95
Copy link
Contributor Author

@villebro please check now.

@villebro
Copy link
Member

@villebro just to specify this part of the test case failing without this change, I removed the change keeping the test case. Check these job run failures - MYSQL and Postgres.

@sinhashubham95 oh, now I get it, the test didn't fail on sqlite because it doesn't enforce foreign keys 🤦 thanks for helping me get to the bottom of this!

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

@villebro villebro merged commit 7edf1fb into apache:master Oct 22, 2022
@sinhashubham95 sinhashubham95 deleted the embedded-fix branch October 22, 2022 11:25
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 2.1.0 and removed 🚢 2.1.3 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/M 🚢 2.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants