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

[PR] feat(world-map): migrate World Map plugin to the v1 chart data API [superset]

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

     ### SUMMARY
     Migrates the World Map chart from the deprecated legacy data endpoint (`/superset/explore_json/`) to the v1 chart data API (`POST /api/v1/chart/data`), and renames the package
     `@superset-ui/legacy-plugin-chart-world-map` → `@superset-ui/plugin-chart-world-map` (1.0.0), following the precedent set by `preset-chart-deckgl` in #38035.
   
     **Rationale**: besides moving one more chart off the deprecated endpoint, this fixes World Map charts in **embedded dashboards**: `/superset/explore_json/` rejects guest tokens unconditionally, so embedded
     users get "Access is Denied" on every World Map chart while all v1-API charts on the same dashboard work.
   
     **Design decisions**:
     - `buildQuery` replicates the legacy `WorldMapViz.query_obj` (`superset/viz.py`) exactly: group by the entity column, request the metric plus the bubble-size metric when distinct (compared via
     `getMetricLabel`, so adhoc metrics dedupe correctly), and translate `sort_by_metric` into an `orderby`.
     - The v1 endpoint returns generic rows keyed by the entity column and metric labels, so `transformProps` now rebuilds the `country/code/name/latitude/longitude/m1/m2` shape the renderer consumes — the
     country-code conversion and centroid/name enrichment that `WorldMapViz.get_data` performed server-side via `superset/examples/countries.py`. The country table is mirrored client-side (`src/countries.ts`,
     case-insensitive lookup like the Python `get()`), including the legacy `m2 = m1` fallback and the `XXX` sentinel for unmappable values.
     - The `world_map` viz key is unchanged, so existing charts keep working without migration. Existing charts should be re-saved (Save → overwrite) to refresh their stored `query_context` before use behind guest
     tokens, since the guest `query_context_modified` check compares against it.
     - The legacy `WorldMapViz` Python class is intentionally left in place; it can be removed in a follow-up together with the other `explore_json` cleanups.
     - Rendering (`WorldMap.ts`/datamaps) is untouched — no visual changes.
   
     ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
     No visual changes — same renderer, new data path. (Before/after of an embedded dashboard: previously "Access is Denied" on World Map charts under a guest token, now rendering.)
   
     ### TESTING INSTRUCTIONS
     1. Open any World Map chart (e.g. from the World Bank's Data example dashboard) in Explore and on a dashboard: choropleth, bubbles (enable "Show Bubbles" with a secondary metric), tooltips, color-by
     country/metric, cross-filtering and drill-to-detail/drill-by all behave as before.
     2. In the network tab, confirm the chart now fetches via `POST /api/v1/chart/data` (no `/superset/explore_json/` request).
     3. Verify each `country_fieldtype` option still maps correctly (cca2/cca3/cioc/full name), including lower-cased values, and that unmappable values are simply omitted from the map.
     4. Embedded regression: with `EMBEDDED_SUPERSET` enabled, embed a dashboard containing a World Map chart and render it with a guest token — the chart loads (previously failed with "Access is Denied"). Re-save
     the chart first if it existed before this change.
     5. Unit tests: `npm run test -- plugins/plugin-chart-world-map` (new `buildQuery`/`transformProps` suites plus the existing renderer suite).
   
     ### ADDITIONAL INFORMATION
     - [ ] Has associated issue:
     - [ ] Required feature flags:
     - [ ] Changes UI
     - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
       - [ ] 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
     - [x] Removes existing feature or API


-- 
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(world-map): migrate World Map plugin to the v1 chart data API [superset]

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

   ## [Codecov](https://app.codecov.io/gh/apache/superset/pull/42356?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 `97.22222%` with `1 line` in your changes missing coverage. Please review.
   :white_check_mark: Project coverage is 65.29%. Comparing base ([`67924ad`](https://app.codecov.io/gh/apache/superset/commit/67924ad35e11ca8ab725a62ca7a221e3e1950e5f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`80378cf`](https://app.codecov.io/gh/apache/superset/commit/80378cfc2c69db656cf7179948479e19ea485d1f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 8 commits behind head on master.
   
   | [Files with missing lines](https://app.codecov.io/gh/apache/superset/pull/42356?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
   |---|---|---|
   | [...ugins/plugin-chart-world-map/src/transformProps.ts](https://app.codecov.io/gh/apache/superset/pull/42356?src=pr&el=tree&filepath=superset-frontend%2Fplugins%2Fplugin-chart-world-map%2Fsrc%2FtransformProps.ts&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c3VwZXJzZXQtZnJvbnRlbmQvcGx1Z2lucy9wbHVnaW4tY2hhcnQtd29ybGQtbWFwL3NyYy90cmFuc2Zvcm1Qcm9wcy50cw==) | 94.44% | [1 Missing :warning: ](https://app.codecov.io/gh/apache/superset/pull/42356?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             @@
   ##           master   #42356      +/-   ##
   ==========================================
   + Coverage   65.28%   65.29%   +0.01%     
   ==========================================
     Files        2793     2795       +2     
     Lines      157260   157295      +35     
     Branches    35955    35972      +17     
   ==========================================
   + Hits       102660   102702      +42     
   + Misses      52623    52616       -7     
     Partials     1977     1977              
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/superset/pull/42356/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [javascript](https://app.codecov.io/gh/apache/superset/pull/42356/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `71.22% <97.22%> (+0.02%)` | :arrow_up: |
   
   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/42356?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(world-map): migrate World Map plugin to the v1 chart data API [superset]

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

   ### <span aria-hidden="true">✅</span> Deploy Preview for *superset-docs-preview* ready!
   
   
   |  Name | Link |
   |:-:|------------------------|
   |<span aria-hidden="true">🔨</span> Latest commit | 80378cfc2c69db656cf7179948479e19ea485d1f |
   |<span aria-hidden="true">🔍</span> Latest deploy log | https://app.netlify.com/projects/superset-docs-preview/deploys/6a6238aecc1e770009d4c25d |
   |<span aria-hidden="true">😎</span> Deploy Preview | [https://deploy-preview-42356--superset-docs-preview.netlify.app](https://deploy-preview-42356--superset-docs-preview.netlify.app) |
   |<span aria-hidden="true">📱</span> Preview on mobile | <details><summary> Toggle QR Code... </summary><br /><br />![QR Code](https://app.netlify.com/qr-code/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1cmwiOiJodHRwczovL2RlcGxveS1wcmV2aWV3LTQyMzU2LS1zdXBlcnNldC1kb2NzLXByZXZpZXcubmV0bGlmeS5hcHAifQ.3EdFNIs6sHbj4pg45Wr_CZSDLDChuACqrdjTilsFI2k)<br /><br />_Use your smartphone camera to open QR code link._</details> |
   |<span aria-hidden="true">🤖</span> Make changes | [Run an agent on this branch](https://app.netlify.com/projects/superset-docs-preview/agent-runs#q1YqKMrPLShRslJS0lFKKkrMS84AstNSE0tKi1L1y_OLclJ0cxMLdMsMdRMLMoFqUlILcvIrPVOAqswSzYyMLRJTk5MNU83NDQwMLFNMko1MU5RqAQ) |
   ---
   <!-- [superset-docs-preview Preview](https://deploy-preview-42356--superset-docs-preview.netlify.app) -->
   _To edit notification comments on pull requests, go to your [Netlify project configuration](https://app.netlify.com/projects/superset-docs-preview/configuration/notifications#deploy-notifications)._


-- 
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(world-map): migrate World Map plugin to the v1 chart data API [superset]

Posted by "Naktibalda (via GitHub)" <gi...@apache.org>.
Naktibalda closed pull request #42356: feat(world-map): migrate World Map plugin to the v1 chart data API
URL: https://github.com/apache/superset/pull/42356


-- 
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(world-map): migrate World Map plugin to the v1 chart data API [superset]

Posted by "Naktibalda (via GitHub)" <gi...@apache.org>.
Naktibalda commented on PR #42356:
URL: https://github.com/apache/superset/pull/42356#issuecomment-5094021156

   Turns out the same migration was already done in #41720 as part of the legacy viz pipeline removal (#41714), merged into the remove-legacy-viz-pipeline branch.


-- 
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(world-map): migrate World Map plugin to the v1 chart data API [superset]

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

   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