You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2026/07/03 07:37:13 UTC

[PR] feat(compare): migrate compare charts to echarts_timeseries_line and drop the legacy plugin [superset]

rusackas opened a new pull request, #41738:
URL: https://github.com/apache/superset/pull/41738

   ### SUMMARY
   
   Tier 3 of #41714 (targets `remove-legacy-viz-pipeline`): retire the nvd3 **Time-series Percent Change (`compare`)** chart by migrating saved charts to the ECharts **Line Chart (`echarts_timeseries_line`)**.
   
   - New `MigrateCompareChart` processor — the shared `TimeseriesChart` base already handles the whole nvd3 timeseries control mapping (including normalizing the legacy `absolute` comparison type), so the subclass only declares the source/target viz types. Registered with the `superset viz-migrations` CLI and covered by a unit test.
   - Alembic revision `e5f6a7b8c9d0` (chained after the bubble migration) with the standard MySQL MEDIUMTEXT widening and reversible `form_data_bak` backups.
   - Removes the nvd3 Compare plugin, its MainPreset/preset registrations, the `NVD3CompareTimeSeriesViz` backend class, and the cumulative-line branch of the shared NVD3 renderer.
   - **Behavior note for UPDATING.md**: the nvd3 renderer's *interactive re-basing* (clicking a point to re-base percent change) is not preserved by the ECharts line chart.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Saved Percent Change charts re-open as ECharts Line Charts.
   
   ### TESTING INSTRUCTIONS
   
   - `pytest tests/unit_tests/migrations/viz/nvd3_compare_chart_to_echarts_test.py` passes.
   - `npm run test -- plugins/legacy-preset-chart-nvd3` passes.
   - Manual: `superset db upgrade` then open a formerly-`compare` chart — renders as an ECharts line chart; `superset db downgrade` restores the original form_data.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [x] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [x] Migration is atomic, supports rollback & is backwards-compatible
     - [x] Confirm DB migration upgrade and downgrade tested
     - [x] Runtime estimates and downtime expectations provided: proportional to the number of saved `compare` slices; no downtime expected
   - [ ] Introduces new feature or API
   - [x] Removes existing feature or API
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(compare): migrate compare charts to echarts_timeseries_line and drop the legacy plugin [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #41738:
URL: https://github.com/apache/superset/pull/41738#issuecomment-4873893398

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(compare): migrate compare charts to echarts_timeseries_line and drop the legacy plugin [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #41738:
URL: https://github.com/apache/superset/pull/41738#discussion_r3518251897


##########
superset/migrations/shared/migrate_viz/processors.py:
##########
@@ -388,6 +388,11 @@ def _build_query(self) -> dict[str, Any]:
         return super()._build_query()
 
 
+class MigrateCompareChart(TimeseriesChart):
+    source_viz_type = "compare"
+    target_viz_type = "echarts_timeseries_line"

Review Comment:
   **Suggestion:** Add explicit type annotations for the new class-level configuration variables so the introduced code complies with required Python type hints. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The custom rule requires type hints on new or modified Python variables that can be annotated. These class-level configuration attributes are new and untyped, so the suggestion correctly identifies a real violation.
   </details>
   
   [![Fix in Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=6eadaf95942d4efd9adef134fcb01e19&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [![Fix in VSCode Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=6eadaf95942d4efd9adef134fcb01e19&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/migrations/shared/migrate_viz/processors.py
   **Line:** 391:393
   **Comment:**
   	*Custom Rule: Add explicit type annotations for the new class-level configuration variables so the introduced code complies with required Python type hints.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41738&comment_hash=43aa503cf9e267e0deddbc3c48d8affb1edab8187fff8641e349eccb3f60cbd7&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41738&comment_hash=43aa503cf9e267e0deddbc3c48d8affb1edab8187fff8641e349eccb3f60cbd7&reaction=dislike'>👎</a>



##########
superset/migrations/versions/2026-07-02_21-30_e5f6a7b8c9d0_migrate_compare_chart_to_echarts.py:
##########
@@ -0,0 +1,55 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""migrate_compare_chart_to_echarts
+
+Revision ID: e5f6a7b8c9d0
+Revises: d4e5f6a7b8c9
+Create Date: 2026-07-02 21:30:00.000000
+
+"""
+
+from alembic import op
+from sqlalchemy import text
+from sqlalchemy.dialects.mysql.base import MySQLDialect
+
+from superset import db
+from superset.migrations.shared.migrate_viz import MigrateCompareChart
+
+# revision identifiers, used by Alembic.
+revision = "e5f6a7b8c9d0"
+down_revision = "d4e5f6a7b8c9"
+
+
+def upgrade():

Review Comment:
   **Suggestion:** Add an explicit return type annotation to this migration function to satisfy the required type-hint rule. [custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The migration defines a new Python function without any type annotation, which matches the type-hint rule for functions that can be annotated. A return type such as `-> None` should be added.
   </details>
   
   [![Fix in Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=66d51cf631f0462983fd9831af4d0de7&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset) [![Fix in VSCode Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=66d51cf631f0462983fd9831af4d0de7&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/migrations/versions/2026-07-02_21-30_e5f6a7b8c9d0_migrate_compare_chart_to_echarts.py
   **Line:** 37:37
   **Comment:**
   	*Custom Rule: Add an explicit return type annotation to this migration function to satisfy the required type-hint rule.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41738&comment_hash=b32774f77e6f4c0dc2ffcde452791cd349891da9e02d6a8fc6af055fe2a4a504&reaction=like'>👍</a> | <a href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41738&comment_hash=b32774f77e6f4c0dc2ffcde452791cd349891da9e02d6a8fc6af055fe2a4a504&reaction=dislike'>👎</a>



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(compare): migrate compare charts to echarts_timeseries_line and drop the legacy plugin [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on code in PR #41738:
URL: https://github.com/apache/superset/pull/41738#discussion_r3518807945


##########
superset/migrations/shared/migrate_viz/processors.py:
##########
@@ -388,6 +388,11 @@ def _build_query(self) -> dict[str, Any]:
         return super()._build_query()
 
 
+class MigrateCompareChart(TimeseriesChart):
+    source_viz_type = "compare"
+    target_viz_type = "echarts_timeseries_line"

Review Comment:
   These are already typed as `str` on the `MigrateViz` base class, so the subclass assignments are covered — same pattern as every other migrator in this file.



##########
superset/migrations/versions/2026-07-02_21-30_e5f6a7b8c9d0_migrate_compare_chart_to_echarts.py:
##########
@@ -0,0 +1,55 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""migrate_compare_chart_to_echarts
+
+Revision ID: e5f6a7b8c9d0
+Revises: d4e5f6a7b8c9
+Create Date: 2026-07-02 21:30:00.000000
+
+"""
+
+from alembic import op
+from sqlalchemy import text
+from sqlalchemy.dialects.mysql.base import MySQLDialect
+
+from superset import db
+from superset.migrations.shared.migrate_viz import MigrateCompareChart
+
+# revision identifiers, used by Alembic.
+revision = "e5f6a7b8c9d0"
+down_revision = "d4e5f6a7b8c9"
+
+
+def upgrade():

Review Comment:
   Added `-> None` to both `upgrade()` and `downgrade()`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(compare): migrate compare charts to echarts_timeseries_line and drop the legacy plugin [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #41738:
URL: https://github.com/apache/superset/pull/41738#discussion_r3518810864


##########
superset/migrations/shared/migrate_viz/processors.py:
##########
@@ -388,6 +388,11 @@ def _build_query(self) -> dict[str, Any]:
         return super()._build_query()
 
 
+class MigrateCompareChart(TimeseriesChart):
+    source_viz_type = "compare"
+    target_viz_type = "echarts_timeseries_line"

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > Do not flag subclass class-level assignments for inherited typed configuration variables when the base class already declares the type; this pattern is intentional for migrator classes.
   
   **Applied to:**
     - `superset/migrations/shared/migrate_viz/**`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI Settings](https://app.codeant.ai/org/settings/learnings)*



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(compare): migrate compare charts to echarts_timeseries_line and drop the legacy plugin [superset]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #41738:
URL: https://github.com/apache/superset/pull/41738#issuecomment-4874050508

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/41738?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :x: Patch coverage is `60.00000%` with `2 lines` in your changes missing coverage. Please review.
   :warning: Please [upload](https://docs.codecov.com/docs/codecov-uploader) report for BASE (`remove-legacy-viz-pipeline@ea90b59`). [Learn more](https://docs.codecov.io/docs/error-reference?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#section-missing-base-commit) about missing BASE report.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/41738?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...nd/plugins/legacy-preset-chart-nvd3/src/NVD3Vis.ts](https://app.codecov.io/gh/apache/superset/pull/41738?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Flegacy-preset-chart-nvd3%2Fsrc%2FNVD3Vis.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9sZWdhY3ktcHJlc2V0LWNoYXJ0LW52ZDMvc3JjL05WRDNWaXMudHM=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/41738?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [superset/cli/viz\_migrations.py](https://app.codecov.io/gh/apache/superset/pull/41738?src=pr&el=tree&filepath=superset%2Fcli%2Fviz_migrations.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQvY2xpL3Zpel9taWdyYXRpb25zLnB5) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/41738?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@                      Coverage Diff                      @@
   ##             remove-legacy-viz-pipeline   #41738   +/-   ##
   =============================================================
     Coverage                              ?   63.99%           
   =============================================================
     Files                                 ?     2702           
     Lines                                 ?   149087           
     Branches                              ?    34475           
   =============================================================
     Hits                                  ?    95403           
     Misses                                ?    51936           
     Partials                              ?     1748           
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/41738/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [hive](https://app.codecov.io/gh/apache/superset/pull/41738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `39.20% <75.00%> (?)` | |
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/41738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `69.63% <0.00%> (?)` | |
   | [presto](https://app.codecov.io/gh/apache/superset/pull/41738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `40.75% <75.00%> (?)` | |
   | [python](https://app.codecov.io/gh/apache/superset/pull/41738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.64% <75.00%> (?)` | |
   | [sqlite](https://app.codecov.io/gh/apache/superset/pull/41738/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `57.49% <75.00%> (?)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/superset/pull/41738?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] feat(compare): migrate compare charts to echarts_timeseries_line and drop the legacy plugin [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #41738:
URL: https://github.com/apache/superset/pull/41738


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org