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(dash import): Ensure old datasource ids are not referenced in imported charts #23582

Conversation

jfrag1
Copy link
Member

@jfrag1 jfrag1 commented Apr 5, 2023

SUMMARY

Currently, charts imported via a dashboard import contain references to the chart's old datasource id from when it was exported within their params and query_context. This didn't result in any functionality breaking, but it would result in the following "false alarm" error message when loading the dashboard:

Clipboard 2023-02-03 at 5 35 47 PM

There is precedent for this fix in the individual chart import, see here: https://github.com/apache/superset/blob/master/superset/charts/commands/importers/v1/__init__.py#L96

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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

@jfrag1 jfrag1 changed the title fix(dash import): Ensure old datasource ids is not referenced in imported charts fix(dash import): Ensure old datasource ids are not referenced in imported charts Apr 5, 2023
@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Merging #23582 (f4a1ee5) into master (9d2f43d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head f4a1ee5 differs from pull request most recent head 0b39a95. Consider uploading reports for the commit 0b39a95 to get more accurate results

@@           Coverage Diff           @@
##           master   #23582   +/-   ##
=======================================
  Coverage   67.71%   67.72%           
=======================================
  Files        1916     1916           
  Lines       74014    74019    +5     
  Branches     8039     8039           
=======================================
+ Hits        50122    50126    +4     
- Misses      21843    21844    +1     
  Partials     2049     2049           
Flag Coverage Δ
hive 52.73% <0.00%> (-0.01%) ⬇️
mysql 78.49% <100.00%> (+<0.01%) ⬆️
postgres 78.57% <100.00%> (+<0.01%) ⬆️
presto 52.66% <0.00%> (-0.01%) ⬇️
python 82.41% <100.00%> (-0.01%) ⬇️
sqlite 77.08% <100.00%> (+<0.01%) ⬆️
unit 52.62% <0.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
...erset/dashboards/commands/importers/v1/__init__.py 98.63% <100.00%> (+0.10%) ⬆️

... and 1 file with indirect coverage changes

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

Copy link
Member

@eschutho eschutho left a comment

Choose a reason for hiding this comment

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

lgtm but @betodealmeida may be more familiar with this code.

Copy link
Member

@betodealmeida betodealmeida left a comment

Choose a reason for hiding this comment

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

Looks great, thanks for fixing this!

@betodealmeida betodealmeida merged commit 7034401 into apache:master Apr 5, 2023
@betodealmeida betodealmeida deleted the jack/fix-dash-import-params-and-query-context-on-charts branch April 5, 2023 20:38
@santosh-sahoo334
Copy link

Thanks! I was exactly looking for this. So If I import any dashboard from let say 1.5.1 to 2.1.1, it should not produce the false alarm.

eschutho pushed a commit to preset-io/superset that referenced this pull request May 23, 2023
eschutho pushed a commit that referenced this pull request May 23, 2023
vik4114 added a commit to vik4114/superset that referenced this pull request May 25, 2023
eschutho pushed a commit that referenced this pull request May 25, 2023
eschutho pushed a commit that referenced this pull request May 31, 2023
jfrag1 added a commit to preset-io/superset that referenced this pull request Aug 25, 2023
@mistercrunch mistercrunch added 🍒 2.1.1 🍒 2.1.2 🍒 2.1.3 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.0.0 labels Mar 13, 2024
denodo-research-labs pushed a commit to denodo-research-labs/superset that referenced this pull request Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.1.1 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/S v2.1 🍒 2.1.1 🍒 2.1.2 🍒 2.1.3 🚢 3.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants