Repository navigation
Conversation
Several fixes on master were applied directly to generated files, so the weekly `npm run update-maps` regeneration (#46240) reverted them and broke the country-map tests. Move each one into the notebook: - Iran: Alborz gets IR-32 (#42429) instead of IR-30. - UK: GB-WRL is named "Wirral", not Natural Earth's duplicate "Halton". - Russia: simplify the 1:10m Karelia/Murmansk rows at 0.03 (#44273) so russia.geojson stays under its size budget. - countries.ts / docs countries.json: label italy_regions_and_autonomous_provinces as "Italy (regions and autonomous provinces)" (#42309). Co-Authored-By: Evan Rusackas <evan@preset.io> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the generator-notebook update intended to preserve existing country-map corrections during regeneration.
No open issues 🎉
What changed in this PR
Updates the country-map generator notebook to preserve existing fixes during regeneration, preventing generated files from reverting corrections already committed to Superset.
Changes:
- Preserves Alborz’s
IR-32code and corrects Wirral’s region name. - Simplifies Karelia and Murmansk boundaries to keep Russia’s generated map within its size budget.
- Preserves the “Italy (regions and autonomous provinces)” label in generated frontend and documentation catalogs.
| File | Description |
|---|---|
superset-frontend/plugins/plugin-chart-country-map/scripts/Country Map GeoJSON Generator.ipynb |
Updates generator logic and explanatory notes for all four fixes; leaves notebook outputs and generated files unchanged. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
The weekly country-map regeneration (#46240) fails four frontend test shards because it reverts fixes that were made by hand to generated files on
master, without a matching change to the generator notebook. This moves each of those fixes intoCountry Map GeoJSON Generator.ipynb, so the nextnpm run update-mapsrun keeps them.Fixes ported (notebook cell sources only, no output changes):
IR-32, notIR-30. The notebook's Iran cell still setIR-30; it now setsIR-32, and the cell's note explains why (every other province uses the pre-2020 numbering).GB-WRL"Halton", which duplicates the real Halton (GB-HAL). The UK cell now names it "Wirral".russia.geojsongrows to ~829 kB and failsrussia.geojson.test.ts's 760 kB cap. With it, Karelia and Murmansk come out coordinate-for-coordinate identical to master, and the file is ~749 kB.countries.tskeeps theitaly_regions_and_autonomous_provinces→ "Italy (regions and autonomous provinces)" case, anddocs/data/countries.jsongets the same label instead of "Italy (regions) And Autonomous Provinces".Everything else #46240 changes is upstream drift, not master-only fixes: small vertex changes in Iran (Natural Earth) and Madagascar (the live WHO query), last-digit float noise in South Africa, and Russia being pretty-printed instead of master's minified copy. There's also a 1e-9° Chukchi offset, which the notebook already adds on purpose (#44273) and the committed file just never picked up.
#45607 (moving the notebook to per-country build scripts) already carries all four fixes in its
maps/countries/{iran,uk,russia}.pyandmaps/ts_writer.py. One small difference: its Russia script simplifies withpreserve_topology=False, which gives slightly different Karelia/Murmansk geometry from master's file (186/179 vertices vs 191/190). That's still well within the test's bounds. This PR is the stopgap for the notebook until #45607 lands.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A, generator-only change. The committed GeoJSON/TS/JSON files are not touched.
TESTING INSTRUCTIONS
I ran the notebook end to end the same way
update-country-maps.ymldoes (pinned deps fromrequirements-constraints.txt,speed_runforced on,nbconvert --execute). It finished with no cell errors. Then:uk.geojson,countries.tsanddocs/data/countries.jsonare byte-identical to master.iran.geojson, every province's ISO/name matches master (Alborz isIR-32).russia.geojson, all 85 features match master except the 1e-9 Chukchi offset noted above, and the file is 749,169 bytes.JEST_MAX_WORKERS=2 npm run test -- plugins/plugin-chart-country-mappasses 11/11 suites (92 tests), includingiran.geojson,russia.geojson,normalizeRegionsandcountries.To reproduce, run
npm run update-mapsfromsuperset-frontendand check that the country-map tests still pass.ADDITIONAL INFORMATION
🤖 Generated with Claude Code