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: Add Bubble chart migration logic #26033

Merged

Conversation

michael-s-molina
Copy link
Member

SUMMARY

This PR adds the Bubble chart migration logic (NVD3 ➡️ ECharts). Users can execute this migration using the #25304 CLI command and disable the legacy version with the VIZ_TYPE_DENYLIST configuration.

@sadpandajoe @jinghua-qa

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshot 2023-11-20 at 11 25 25 Screenshot 2023-11-20 at 11 29 29

TESTING INSTRUCTIONS

1 - Upgrade a Bubble chart using the CLI command
2 - Check the new chart
3 - Downgrade a Bubble chart using the CLI command
4 - Check the legacy chart

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

Copy link

codecov bot commented Nov 20, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (bece2ea) 69.05% compared to head (2e05d3a) 69.08%.
Report is 10 commits behind head on master.

Files Patch % Lines
.../plugin-chart-echarts/src/Bubble/transformProps.ts 50.00% 0 Missing and 2 partials ⚠️
superset/cli/viz_migrations.py 0.00% 1 Missing ⚠️
...perset/migrations/shared/migrate_viz/processors.py 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #26033      +/-   ##
==========================================
+ Coverage   69.05%   69.08%   +0.03%     
==========================================
  Files        1938     1941       +3     
  Lines       75837    75896      +59     
  Branches     8427     8444      +17     
==========================================
+ Hits        52367    52434      +67     
+ Misses      21300    21286      -14     
- Partials     2170     2176       +6     
Flag Coverage Δ
hive 53.67% <46.15%> (-0.01%) ⬇️
javascript 56.27% <50.00%> (+0.05%) ⬆️
mysql 78.14% <46.15%> (-0.05%) ⬇️
postgres 78.24% <46.15%> (-0.05%) ⬇️
presto 53.62% <46.15%> (-0.01%) ⬇️
python 82.91% <84.61%> (+0.01%) ⬆️
sqlite 76.90% <46.15%> (-0.05%) ⬇️
unit 55.75% <84.61%> (+0.05%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michael-s-molina michael-s-molina changed the title feat: Add Bubble chart migration feat: Add Bubble chart migration logic Nov 20, 2023
source_viz_type = "bubble"
target_viz_type = "bubble_v2"
rename_keys = {
"bottom_margin": "x_axis_title_margin",
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated, but what's the reason we have a mix of snake- and camel-case in the chart properties?

Copy link
Member Author

@michael-s-molina michael-s-molina Nov 21, 2023

Choose a reason for hiding this comment

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

It's always the same answer... 😏

superset/migrations/shared/migrate_viz/processors.py Outdated Show resolved Hide resolved
self.data["x_ticks_layout"] = 45 if x_ticks_layout == "45°" else 0

# Truncate Y-axis by default to preserve layout
self.data["y_axis_showminmax"] = True
Copy link
Member

Choose a reason for hiding this comment

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

Just to confirm, this occurs prior to the renaming of the keys?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep

if self.data.get("x_axis_label") and (
not bottom_margin or bottom_margin == "auto"
):
self.data["bottom_margin"] = 30
Copy link
Member

Choose a reason for hiding this comment

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

Any reason the bottom margin is now fix to 30 (pixels?) as opposed to being automatic?

Copy link
Member Author

@michael-s-molina michael-s-molina Nov 21, 2023

Choose a reason for hiding this comment

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

Layout adjustments to match the legacy version's look.

Co-authored-by: John Bodley <4567245+john-bodley@users.noreply.github.com>
Copy link
Member

@john-bodley john-bodley left a comment

Choose a reason for hiding this comment

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

LGTM

@michael-s-molina michael-s-molina merged commit 68e5e1a into apache:master Nov 21, 2023
josedev-union pushed a commit to Ortege-xyz/studio that referenced this pull request Jan 22, 2024
Co-authored-by: John Bodley <4567245+john-bodley@users.noreply.github.com>
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
Co-authored-by: John Bodley <4567245+john-bodley@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 🚢 3.1.0 labels Mar 8, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
Co-authored-by: John Bodley <4567245+john-bodley@users.noreply.github.com>
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 2024
Co-authored-by: John Bodley <4567245+john-bodley@users.noreply.github.com>
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 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants