Skip to content

fix(viz): correct duplicate/incorrect ISO codes in Iran country map#42439

Open
rusackas wants to merge 1 commit into
masterfrom
fix/issue-31991-iran-geojson-iso-codes
Open

fix(viz): correct duplicate/incorrect ISO codes in Iran country map#42439
rusackas wants to merge 1 commit into
masterfrom
fix/issue-31991-iran-geojson-iso-codes

Conversation

@rusackas

Copy link
Copy Markdown
Member

SUMMARY

Tehran and Alborz provinces in iran.geojson were both mapped to IR-07, and Razavi Khorasan was mapped to IR-30 (Alborz's real code), leaving IR-09 unused entirely. That made it impossible to color Tehran and Alborz independently in the country map viz, and any data keyed on IR-09 (Razavi Khorasan) or IR-30 (Alborz) would land on the wrong province. This matches what came up in #31991: Alborz now gets IR-30 and Razavi Khorasan gets IR-09, per ISO 3166-2:IR. Tehran keeps IR-07.

Added a unit test that pins this down going forward by asserting every province in the geojson has a unique ISO code and that the three provinces in question map correctly.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A, this only touches the underlying geojson data, not rendering code.

TESTING INSTRUCTIONS

npm run test -- plugins/legacy-plugin-chart-country-map/test/countries/iran.test.ts

Or build a country map chart with country set to Iran and confirm Tehran and Alborz can be colored independently.

ADDITIONAL INFORMATION

Fixes #31991

Tehran and Alborz provinces both used IR-07 in the Iran GeoJSON, and
Razavi Khorasan was assigned IR-30 (Alborz's actual code), leaving
IR-09 unused. This made it impossible to color Tehran and Alborz
independently on the country map viz and mapped Razavi Khorasan data
to the wrong region. Alborz now uses IR-30 and Razavi Khorasan uses
IR-09, matching ISO 3166-2:IR, with a test pinning uniqueness of the
ISO codes.

Fixes #31991
@rusackas
rusackas requested a review from villebro as a code owner July 26, 2026 13:45
@dosubot dosubot Bot added change:frontend Requires changing the frontend viz:charts:map Related to Map charts labels Jul 26, 2026
@bito-code-review

bito-code-review Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #bc4e51

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 85a4903..85a4903
    • superset-frontend/plugins/legacy-plugin-chart-country-map/test/countries/iran.test.ts
  • Files skipped - 0
  • Tools
    • Eslint (Linter) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.23%. Comparing base (ba0900d) to head (85a4903).

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #42439   +/-   ##
=======================================
  Coverage   65.23%   65.23%           
=======================================
  Files        2795     2795           
  Lines      157694   157694           
  Branches    36067    36067           
=======================================
  Hits       102871   102871           
  Misses      52847    52847           
  Partials     1976     1976           
Flag Coverage Δ
javascript 71.27% <ø> (ø)

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:frontend Requires changing the frontend plugins size/M viz:charts:map Related to Map charts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

duplicate iso code in iran's country map

1 participant