You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/08/25 23:59:55 UTC

(superset) branch master updated: fix(country-map): give Alborz its own ISO code instead of reusing Tehran's (#42429)

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new e6b9205821b fix(country-map): give Alborz its own ISO code instead of reusing Tehran's (#42429)
e6b9205821b is described below

commit e6b9205821b752a0e434aba1f46ed0a51ddd3d62
Author: Evan Rusackas <ev...@preset.io>
AuthorDate: Tue Aug 25 16:59:48 2026 -0700

    fix(country-map): give Alborz its own ISO code instead of reusing Tehran's (#42429)
    
    Co-authored-by: Claude Opus 4.8 <no...@anthropic.com>
    Co-authored-by: Joe Li <jo...@preset.io>
    Co-authored-by: Đỗ Trọng Hải <41...@users.noreply.github.com>
---
 UPDATING.md                                        |   1 +
 .../src/countries/iran.geojson                     | Bin 134537 -> 134537 bytes
 .../test/iran.geojson.test.ts                      |  69 +++++++++++++++++++++
 3 files changed, 70 insertions(+)

diff --git a/UPDATING.md b/UPDATING.md
index cc2a0fadde1..56b0d1e9a0c 100644
--- a/UPDATING.md
+++ b/UPDATING.md
@@ -58,6 +58,7 @@ the old counter to use the outcome-specific replacements.
 
 - [42930](https://github.com/apache/superset/pull/42930): Dataset import data-URI fetches no longer honor an HTTP(S) proxy when `DATASET_IMPORT_ALLOW_INTERNAL_DATA_URLS` is `False` (the default): the connection is now made directly to the destination so the peer-address check validates the real target instead of a proxy's. Deployments that require an egress proxy to reach legitimate external data URLs for dataset import should set `DATASET_IMPORT_ALLOW_INTERNAL_DATA_URLS = True` or other [...]
 - [42935](https://github.com/apache/superset/pull/42935): The MCP service now refuses to start (`MCPAuthConfigError`) when `MCP_JWT_ISSUER` trusts more than one issuer and no `MCP_USER_RESOLVER` is configured, instead of only logging a warning. This was already a documented misconfiguration (the default resolver isn't issuer-scoped, so distinct trusted issuers minting the same username/email would resolve to the same Superset user); deployments trusting multiple issuers must configure an [...]
+- [42429](https://github.com/apache/superset/pull/42429): The Country Map chart's Iran GeoJSON now gives Alborz province its own ISO 3166-2 code, `IR-32`, instead of `IR-30`. `ISO` is the join key used to color/filter provinces on this chart, so any existing dataset keyed on `IR-30` for Alborz will silently stop matching after upgrading; re-key that data to `IR-32`.
 - [43388](https://github.com/apache/superset/pull/43388): The MCP service now refuses to start (`MCPAuthConfigError`) if `MCP_DEV_USERNAME` and `MCP_AUTH_ENABLED = True` are both set, and separately if `MCP_AUTH_ENABLED = True` but no usable JWT key material is configured (RSA key/JWKS, or an explicit `MCP_JWT_SECRET` for HMAC) — both previously started with authentication silently weaker than configured. Deployments combining a dev-mode username with JWT auth enabled, or enabling JWT au [...]
 - [42393](https://github.com/apache/superset/pull/42393): Exported dataset YAML now carries a `uuid` for each metric and column so that custom folder assignments (which reference metrics/columns by UUID) survive an import into another workspace. This affects any export bundle that contains datasets, not just a dataset export: chart, dashboard, database and full-asset exports all embed the same dataset YAML, so a dashboard exported from this release also fails to import into an older one  [...]
 - [42300](https://github.com/apache/superset/pull/42300): Timeseries charts (line/area/bar) with a Y-axis bound in effect — either an explicit `yAxisBounds` or one derived from `truncateYAxis` — now clamp out-of-range data points to that bound instead of letting ECharts drop the point (and the line segments around it) entirely. Any existing chart with a configured Y-axis bound and data outside it will look different after upgrading: a gap becomes a point pinned to the boundary. The clamp [...]
diff --git a/superset-frontend/plugins/plugin-chart-country-map/src/countries/iran.geojson b/superset-frontend/plugins/plugin-chart-country-map/src/countries/iran.geojson
index 047e1ca22e3..a4c1818984c 100644
Binary files a/superset-frontend/plugins/plugin-chart-country-map/src/countries/iran.geojson and b/superset-frontend/plugins/plugin-chart-country-map/src/countries/iran.geojson differ
diff --git a/superset-frontend/plugins/plugin-chart-country-map/test/iran.geojson.test.ts b/superset-frontend/plugins/plugin-chart-country-map/test/iran.geojson.test.ts
new file mode 100644
index 00000000000..c32345b965c
--- /dev/null
+++ b/superset-frontend/plugins/plugin-chart-country-map/test/iran.geojson.test.ts
@@ -0,0 +1,69 @@
+/**
+ * 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.
+ */
+
+import fs from 'fs';
+import path from 'path';
+
+type Feature = {
+  properties: {
+    ISO: string;
+    NAME_1: string;
+  };
+};
+
+// `.geojson` imports are mocked out to an empty object by the Jest module
+// mapper (see jest.config.js), so the file is read from disk directly to
+// exercise the real, committed data.
+function loadIranGeoJson(): { features: Feature[] } {
+  const filePath = path.join(__dirname, '../src/countries/iran.geojson');
+  return JSON.parse(fs.readFileSync(filePath, 'utf-8'));
+}
+
+test('every Iranian province has its own distinct ISO 3166-2 code', () => {
+  const { features } = loadIranGeoJson();
+
+  // Pin the feature count too, so dropping a province other than
+  // Tehran/Alborz (which would still leave every remaining ISO code
+  // distinct) doesn't slip past the checks below.
+  expect(features.length).toBe(31);
+
+  // Sanity check: every province name in this file is unique, so a
+  // duplicate ISO code below can only mean two different provinces were
+  // mistakenly assigned the same code (as opposed to one province being
+  // split across multiple polygon features).
+  const names = features.map(feature => feature.properties.NAME_1);
+  expect(new Set(names).size).toBe(names.length);
+
+  const isoByName = new Map(
+    features.map(feature => [
+      feature.properties.NAME_1,
+      feature.properties.ISO,
+    ]),
+  );
+  const isoCodes = features.map(feature => feature.properties.ISO);
+
+  expect(new Set(isoCodes).size).toBe(isoCodes.length);
+
+  // Tehran and Alborz were split into separate provinces in 2010, but the
+  // GeoJSON still assigned both the same ISO code (IR-07), which used to
+  // make it impossible to distinguish them on the Country Map chart. Alborz
+  // now uses its pre-2020 ISO 3166-2 code, IR-32.
+  expect(isoByName.get('Tehran')).toBe('IR-07');
+  expect(isoByName.get('Alborz')).toBe('IR-32');
+});