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: Adds Line chart migration logic #23973

Merged
merged 5 commits into from
Nov 9, 2023

Conversation

michael-s-molina
Copy link
Member

@michael-s-molina michael-s-molina commented May 8, 2023

SUMMARY

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

@sadpandajoe @jinghua-qa

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshot 2023-09-19 at 11 08 10 Screenshot 2023-09-19 at 11 09 30

TESTING INSTRUCTIONS

1 - Upgrade a Line chart using the CLI command
2 - Check the new chart
3 - Downgrade a Line 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

@michael-s-molina michael-s-molina added risk:breaking-change Issues or PRs that will introduce breaking changes hold! On hold v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch labels May 8, 2023
@pull-request-size pull-request-size bot added size/L and removed size/M labels May 22, 2023
@michael-s-molina michael-s-molina removed the v3.0 Label added by the release manager to track PRs to be included in the 3.0 branch label Jun 26, 2023
@pull-request-size pull-request-size bot added size/M and removed size/L labels Sep 18, 2023
@michael-s-molina michael-s-molina removed risk:breaking-change Issues or PRs that will introduce breaking changes hold! On hold labels Sep 18, 2023
@michael-s-molina michael-s-molina marked this pull request as ready for review September 19, 2023 14:11
@michael-s-molina michael-s-molina requested a review from a team as a code owner September 19, 2023 14:11
@michael-s-molina michael-s-molina changed the title feat: Migrates Line chart feat: Adds Line chart migration logic Sep 19, 2023
@@ -29,6 +29,7 @@ class VizType(str, Enum):
AREA = "area"
PIVOT_TABLE = "pivot_table"
SUNBURST = "sunburst"
LINE = "line"
Copy link
Member

Choose a reason for hiding this comment

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

ABC?

has_x_axis_control = True

def _pre_action(self) -> None:
self.data["contributionMode"] = "row" if self.data.get("contribution") else None
Copy link
Member

Choose a reason for hiding this comment

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

Is this (and other attributes) required? Generally if not I think it's cleaner/safer to leave these undefined and fallback to the default.

Copy link
Member Author

Choose a reason for hiding this comment

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

These rules were added to keep visual consistency between the previous and new versions.


def _pre_action(self) -> None:
self.data["contributionMode"] = "row" if self.data.get("contribution") else None
self.data["zoomable"] = False if self.data.get("show_brush") == "no" else True
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.data["zoomable"] = False if self.data.get("show_brush") == "no" else True
self.data["zoomable"] = self.data.get("show_brush") != "no"

):
self.data["bottom_margin"] = 30

if (rolling_type := self.data.get("rolling_type")) and rolling_type != "None":
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 rolling_type is "None" as opposed to None?

Copy link
Member Author

Choose a reason for hiding this comment

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

Many of these safe checks were added as a result of trying to run this migration using our production database which contained really old charts and inconsistent values.


if time_compare := self.data.get("time_compare"):
self.data["time_compare"] = [
value + " ago" for value in as_list(time_compare) if value
Copy link
Member

Choose a reason for hiding this comment

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

Are there causes when value is falsy?

Copy link
Member Author

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

Choose a reason for hiding this comment

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

Same as above.

@michael-s-molina michael-s-molina merged commit 83b7fa9 into apache:master Nov 9, 2023
29 checks passed
josedev-union pushed a commit to Ortege-xyz/studio that referenced this pull request Jan 22, 2024
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@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 13, 2024
sfirke pushed a commit to sfirke/superset that referenced this pull request Mar 22, 2024
vinothkumar66 pushed a commit to vinothkumar66/superset that referenced this pull request Nov 11, 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 🚢 3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants