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: migrate charts on import #24703

Merged
merged 3 commits into from
Jul 21, 2023
Merged

feat: migrate charts on import #24703

merged 3 commits into from
Jul 21, 2023

Conversation

betodealmeida
Copy link
Member

SUMMARY

When importing a chart, migrate it to a new visualization type if possible.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

A legacy area chart:

Screenshot 2023-07-14 at 15-54-49 Preset

When exported and imported into Superset running this branch we get a new echarts area chart:

Screenshot 2023-07-14 at 15-56-33 Superset

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

@betodealmeida betodealmeida requested a review from a team as a code owner July 14, 2023 23:08
@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #24703 (f8c3bba) into master (65fb8e1) will decrease coverage by 0.03%.
The diff coverage is 78.17%.

❗ Current head f8c3bba differs from pull request most recent head 83bb63f. Consider uploading reports for the commit 83bb63f to get more accurate results

@@            Coverage Diff             @@
##           master   #24703      +/-   ##
==========================================
- Coverage   68.97%   68.95%   -0.03%     
==========================================
  Files        1901     1902       +1     
  Lines       74006    73929      -77     
  Branches     8182     8175       -7     
==========================================
- Hits        51045    50975      -70     
- Misses      20840    20841       +1     
+ Partials     2121     2113       -8     
Flag Coverage Δ
hive 54.14% <39.07%> (+0.01%) ⬆️
mysql 79.17% <64.90%> (-0.19%) ⬇️
postgres 79.27% <68.21%> (-0.18%) ⬇️
presto 54.03% <39.07%> (+0.01%) ⬆️
python 83.33% <78.14%> (-0.12%) ⬇️
sqlite 77.84% <64.90%> (-0.19%) ⬇️
unit 54.96% <57.61%> (+0.12%) ⬆️

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

Impacted Files Coverage Δ
...src/components/ColumnTypeLabel/ColumnTypeLabel.tsx 100.00% <ø> (ø)
...d/packages/superset-ui-chart-controls/src/index.ts 100.00% <ø> (ø)
...-chart-controls/src/sections/advancedAnalytics.tsx 14.28% <ø> (ø)
...rset-ui-chart-controls/src/sections/chartTitle.tsx 100.00% <ø> (ø)
...legacy-plugin-chart-partition/src/controlPanel.tsx 25.00% <ø> (ø)
...gins/legacy-plugin-chart-rose/src/controlPanel.tsx 50.00% <ø> (ø)
...gins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx 100.00% <ø> (ø)
.../BigNumber/BigNumberWithTrendline/controlPanel.tsx 16.66% <ø> (ø)
...s/plugin-chart-echarts/src/Funnel/controlPanel.tsx 66.66% <ø> (ø)
...ns/plugin-chart-echarts/src/Gauge/controlPanel.tsx 66.66% <ø> (ø)
... and 45 more

... and 10 files with indirect coverage changes

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

@betodealmeida
Copy link
Member Author

Ping @michael-s-molina, care to take another look? 🙇🏼

@@ -31,6 +32,12 @@
Base = declarative_base()


class ChartMigratorStatus(Enum):
Copy link
Member

Choose a reason for hiding this comment

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

It's only the Area migration that is incomplete. I don't think it's a good idea to create this enum because we don't want to allow incomplete or not implemented migrations. Can we assume that all new migrations should be complete and just skip area for now when importing?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I just worried that in the future someone's going to fix the area migration but will not change the import logic. I'll leave a comment in the area migrator.

Copy link
Member

Choose a reason for hiding this comment

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

@betodealmeida I'm already working on the Area migration in #23870. Adding a comment to the code sounds great!

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you for the PR @betodealmeida and for addressing all comments!

@michael-s-molina michael-s-molina added the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Jul 21, 2023
@betodealmeida betodealmeida merged commit abb8e28 into master Jul 21, 2023
55 checks passed
michael-s-molina pushed a commit that referenced this pull request Jul 26, 2023
@mistercrunch mistercrunch added 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 3.1.0 labels Mar 8, 2024
@mistercrunch mistercrunch deleted the migrate-charts-on-import branch March 26, 2024 17:59
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 v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch 🍒 3.0.0 🍒 3.0.1 🍒 3.0.2 🍒 3.0.3 🍒 3.0.4 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants