Skip to content

feat(mcp): add typed geographic chart generation - #44148

Merged
rusackas merged 99 commits into
apache:masterfrom
aminghadersohi:mcp-geographic-chart-types
Oct 11, 2026
Merged

rusackas merged 99 commits into
apache:masterfrom
aminghadersohi:mcp-geographic-chart-types

Conversation

@aminghadersohi

@aminghadersohi aminghadersohi commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

SUMMARY

Add end-to-end typed geographic chart generation to MCP so migration and chart-building clients can discover and create native maps instead of substituting unrelated charts.

Public contract

generate_chart, update_chart, and generate_explore_link share three new config discriminators: country_map, world_map, and deck_scatter. Separate types match native visualization keys and existing runtime capability probes. get_chart_type_schema returns closed, bounded schemas and examples for each; no consuming-skill changes are needed.

{"chart_type":"country_map","country":"usa","region_format":"abbreviation","entity":{"name":"state"},"metric":{"name":"sales","aggregate":"SUM"},"filters":[{"column":"country","op":"IN","value":["USA"]}]}
{"chart_type":"world_map","country_format":"cca2","entity":{"name":"country"},"metric":{"name":"sales","aggregate":"SUM"},"show_bubbles":true,"secondary_metric":{"name":"population","aggregate":"SUM"}}
{"chart_type":"deck_scatter","latitude":{"name":"latitude"},"longitude":{"name":"longitude"},"radius_metric":{"name":"orders","aggregate":"COUNT"},"point_unit":"square_m"}

Pass one of these objects inside config, alongside the tool's dataset/chart identifier.

Behavior and validation

  • Country maps explicitly select a boundary set (usa, canada, australia, japan, uk) and value format (name, abbreviation, iso_3166_2). Resolution uses the actual bundled GeoJSON identifiers: exact matches first, then only unique case/diacritic-insensitive matches. There is no fuzzy geocoding. Compact backend/frontend lookups have geometry-parity tests.
  • Unrecognized or ambiguous regions, duplicate groups resolving to one boundary, invalid aliases, nonfinite metrics, and invalid coordinates return structured errors. No returned geographic rows silently disappear. Source values remain intact for export and country-map cross-filter/drill actions.
  • World choropleth and bubble metrics, deduplication, and ordering follow the native plugin. Geographic points use native longitude/latitude query order, spatial null filters, radius units, and a keyless MapLibre basemap.
  • Compilation checks the configured result, bounded at 10,000 rows, rather than a two-row sample. This does not audit rows excluded by filters or limits.
  • Saved/unsaved generation, updates, cached previews, dataset rebinding, query-context form-data seeding, data/export, and Explore paths use the contract. Omitted controls survive same-type updates; explicit nullable roles/empty filters clear them. Rebinding requires a complete typed config and removes old dataset roles/filter state.
  • ASCII/table previews are explicitly data-only. Vega previews return UnsupportedGeographicPreview, never a misleading bar chart or invented map geometry.

Compatibility

The branch incorporates upstream Country Map conditional formatting with a regression test for formatting normalized regions. Existing non-geographic types retain their behavior, including raw Gauge data exports. Legacy native maps retain their existing behavior unless the explicit regional format or typed MCP contract is selected. Boundary coverage is deliberately bounded and is not a complete ISO registry. Point basemap requests still depend on browser network access and deployment policy.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Screenshots

country_map — US births by state. The typed config drives the native controls: Country USA, ISO 3166-2 Codes = state, Region value format = ISO suffix / abbreviation, SUM(num).

world_map — population by country with bubbles. Country Field Type = code ISO 3166-1 alpha-3 (cca3), choropleth on SUM(SP_POP_TOTL), bubbles sized by the secondary metric (205 countries).

deck_scatter — 10k San Francisco addresses from LON/LAT, autozoomed to the data.

Captured at 4e4c7858. Local docker-compose-light dev env with the examples dataset. All three charts were created through the MCP generate_chart tool (save_chart=true) and opened in Explore. The deck.gl basemap tiles do not paint under headless capture; the stock Superset deck.gl Scatterplot example renders identically here, so it is a capture artifact and not a change in this PR.

Before: these geographic MCP config discriminators were unavailable.

After: clients discover real schemas and generate native maps. A Jest rendering test runs the real D3 projection against USA GeoJSON, verifies a shaded California path, and verifies cross-filtering on the original CA value.

No live deployment/browser screenshot verification was performed. The local UI health endpoint was unavailable and the available staging connector required reauthentication; the rendering evidence above is initialized, in-process coverage, not a claim that a saved chart was visually inspected in a live deployment.

TESTING INSTRUCTIONS

Automated validation:

  • 4,162 MCP unit tests passed, 2 skipped (including initialized FastMCP/ASGI smoke tests). The exact final geographic suite separately passes all 180 tests.
  • 181 frontend tests across 16 country-map, world-map, Scatter, and conditional-formatting suites; includes real-boundary rendering and normalization with upstream conditional formatting.
  • Focused geographic tests cover required/closed schemas, aliases, filters, all public generation entry points (saved and unsaved), cached updates, all three data/export paths, result validation, ambiguity handling, update clearing/rebinding, native query order, form-data seeding, and unsupported geometry previews.
  • Pre-commit: MyPy, Ruff/format, Pylint, frontend type checks, formatting/lint, and remaining applicable hooks pass.
  • Python compile and git diff --check pass. Native plugin TypeScript project builds pass.
  • Local test setup used the repository's normal setup.py version-metadata generation; without generated version metadata, an unrelated health-check smoke failure reproduced on untouched upstream master.

CI budget follow-up (9f8983f): both prior attempts passed 15,248 main unit tests, then exhausted the 30-minute job budget during the independent coverage phase. The job uses the shared 40-minute adjustment from #43770/#43771; all test commands, independent 100% gates, and coverage uploads are unchanged. Geographic tests reuse the compiled config schema without sharing mutable configs (three added isolation cases). Coverage-instrumented focused runs: 167 passed in 58.22s before, 170 passed in 57.36s after. All 13 required exact-head checks are green. The Python job completed in 33m03s: 15,270 main tests passed (5 skipped, 2 xfailed), followed by 1,717 SQL tests and 437 semantic-layer tests, each reaching its unchanged 100% coverage threshold. Successful exact-head run. Prior timeout evidence.

Manual verification:

  1. Probe each type with get_chart_type_schema, then create a saved chart using the returned schema.
  2. For a USA map, verify California, CA, and US-CA with their respective formats. Verify a non-USA value such as BC fails clearly instead of leaving a blank map; selecting Canada resolves BC.
  3. Exercise Australian names/abbreviations, Japanese names, and UK region names against the appropriate boundary set. Check that clicking a normalized region filters on its original source value.
  4. Compare world choropleth color and bubble size with their separate metrics. Verify point locations, sizing units, and automatic viewport fitting in Explore.
  5. Update a metric while omitting presentation controls, explicitly clear optional roles/filters, and rebind with a complete config for another dataset. Confirm old query roles and filters do not leak.
  6. Inspect saved and cached data through JSON/CSV/Excel. Confirm original identifiers are preserved and invalid geographic results return errors. Confirm Vega preview reports its explicit limitation.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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
  • Removes existing feature or API

Maintainer pass (7975e11): merged upstream 39944ff, retained both conflicting documentation sections, and addressed the concrete review suggestions with regression coverage. Full MCP (4,162 passed, 2 skipped), focused geographic (180 passed), frontend (181 passed), native TypeScript builds, and full branch pre-commit checks pass. All 13 required exact-head checks are green on 7975e11. Python CI: 15,288 main tests passed, then both independent 100% coverage gates passed (1,717 SQL tests and 437 semantic-layer tests). The Cypress infrastructure retry also passed; its first attempt failed before tests because the Chrome package mirror returned an inconsistent index size.

Reviewer follow-up (688aa8d): fixed geographic saved/preview dataset rebinding through the strict path and accepted finite database Decimal/real query coordinates and metrics before JSON conversion. Added fail-before/pass-after public FastMCP regressions, saved/cached exports, exact Decimal bounds, and invalid numeric cases. Local full MCP: 4,221 passed, 2 skipped; full branch static checks pass. Upstream 1b03ad8 is merged with Treemap and geographic support retained. All 13 required checks are green on 688aa8d. Exact-head Python CI: 15,351 main tests passed; both independent 100% gates passed (1,717 SQL and 437 semantic-layer tests). Both reviewer threads have individual evidence replies and are fully addressed. No retries were needed on this head.

Reviewer follow-up (af5a062): merged upstream master (UPDATING.md kept both entries). Gantt compile errors return CHART_COMPILE_FAILED; only Gantt bypasses the empty saved Vega-Lite NoDataError; country-map blank-metric regions cross-filter/drill on their source value; select_country is case-insensitive; a world map secondary_metric with bubbles off no longer gates the choropleth (backend and frontend); GB-WRL is labeled Wirral in both the GeoJSON and the region tables; skipped deck_scatter points log a count. Local: MCP unit tests 6,543 passed (3 test_mcp_caching catalog failures reproduce on untouched master with the locally installed FastMCP 3.4.2, not the pinned 3.4.7); 15 frontend suites / 169 tests pass; branch pre-commit (MyPy, Ruff, Pylint, oxfmt, oxlint, frontend type check) passes.

@bito-code-review

bito-code-review Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #4f89e9

Actionable Suggestions - 0
Additional Suggestions - 20
  • superset-frontend/plugins/plugin-chart-country-map/src/transformProps.ts - 1
    • Validation stricter than transform · Line 64-73
      The new validation loop throws for any row whose `row[metricLabel]` is not a finite number, but the transform below (lines 82-92) passes such rows through unchanged via the `: row` branch. A row lacking the metric column (or with a null metric, common for regions with no data) now crashes the whole chart, whereas the transform was designed to render it blank. Skip rows where `metricLabel in row` is false and allow null metrics.
  • superset/mcp_service/chart/tool/get_chart_data.py - 1
    • Over-broad geographic detection · Line 167-174
      The new branches match any categorical column literally named `state`/`province`/`country`/`country_code` (case-insensitive) and immediately return a map recommendation. These are common ambiguous names in non-geographic datasets, so `recommended_visualizations` can be misleading. They also run before the temporal/numeric branch, so a dataset with `latitude`/`longitude` plus a time column loses its time-series suggestions. Consider gating on `not temporal` and a plausible region cardinality.
  • superset/mcp_service/chart/query_result.py - 1
    • Per-row country list rebuild · Line 296-296
      `_geographic_row_identifier` is called once per row (line 348), and for `world_map` it rebuilds `[(c[field], c["cca3"]) for c in countries if c[field]]` (247 entries) on every call. This is O(rows × 247) recomputation of a value that depends only on `form_data`, not the row. Compute the pairs list once in `validate_geographic_query_result` and pass it in.
  • superset-frontend/plugins/plugin-chart-country-map/src/normalizeRegions.ts - 1
    • Per-record region recomputation · Line 88-88
      `resolveRegion` is called once per record (line 88) but rebuilds `entries` via `flatMap` and re-folds every alias (`normalize('NFD')` + regex) on each call. For the UK (230 regions) with a large dataset this is O(N×M) with expensive string normalization per row. Hoist the `entries`/folded-alias construction out of the per-record loop in `normalizeRegions`.
  • superset/mcp_service/chart/schemas.py - 2
    • Country Literal too narrow · Line 2754-2754
      `CountryMapChartConfig.country` is restricted to `Literal["usa","canada","australia","japan","uk"]`, but the frontend `select_country` control (`countryOptions` in `countries.ts`) accepts ~200 country keys plus region keys (`italy_regions`, `france_regions`, etc.). The MCP tool will reject valid `country_map` configs for most countries. Consider widening the Literal to match the frontend's supported set.
    • Missing inline import comment · Line 2651-2652
      Inline imports lack explanatory comment per BITO.md rule [12745]. Add comment documenting circular dependency justification.
  • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts - 2
    • Redundant validation duplication · Line 117-143
      This block duplicates `validate_geographic_query_result` in `query_result.py`, which already rejects non-finite/out-of-range lat/lon and nonnegative metric checks for `deck_scatter` before rendering (see `get_chart_data.py:728`, `compile.py:161`). Duplication risks divergence, and `throw new Error` here would crash the chart render. Consider removing it or returning a graceful error.
    • Object injection sink in record access · Line 123-123
      The code accesses `record[column]` and `record[radiusMetricLabel]` without verifying the property is an own property, which can lead to prototype pollution (CWE-1321). Use `Object.prototype.hasOwnProperty.call()` to safely check property existence before access. The same issue exists at line 135 for `radiusMetricLabel`.
  • superset/mcp_service/chart/compile.py - 1
    • Duplicated error_code logic · Line 166-192
      The `error_code` conditional is duplicated: once for `CompileResult.error_code` (166-168) and again for `ChartGenerationError.error_code` (190-192). Both must stay in sync with `form_data.get("mcp_geographic")`. Extract it into a single local variable and reference it in both places to prevent divergence on future edits.
  • superset/utils/geographic.py - 1
    • Ambiguous valid region name · Line 46-49
      `resolve_region("Halton", "uk", "name")` always raises 'ambiguous' because the bundled UK geometry has two regions named 'Halton' (GB-HAL and GB-WRL, confirmed in `geographic_regions.py` and `uk.geojson`). A legitimate geometry name can never resolve. Consider disambiguating the duplicate name in the data source.
  • superset/mcp_service/chart/preview_utils.py - 1
    • Duplicate geographic viz set · Line 157-157
      The geographic set `{"country_map", "world_map", "deck_scatter"}` is hardcoded twice here (lines 157 and 941), while the identical set already exists as `GEOGRAPHIC_VIZ_TYPES` in `query_result.py`. Reuse that constant so adding a new geographic viz type updates one place instead of risking divergent preview behavior.
  • superset-frontend/plugins/plugin-chart-country-map/src/CountryMap.ts - 1
    • Duplicated source lookup · Line 189-193
      The `data.find(row => row.country_id === code)?.source_value ?? code` lookup is duplicated in `getCrossFilterDataMask` (lines 189-193) and `handleContextMenu` (line 219). If the resolution semantics change in one place, the other can silently diverge. Consider extracting a shared helper.
  • superset-frontend/plugins/plugin-chart-world-map/src/transformProps.ts - 1
    • Array guard bypassed · Line 70-75
      `formData.mcpGeographic ||` short-circuits past the `Array.isArray(rawData)` guard, so `transformData(rawData ?? [], ...)` can be reached with a non-array `rawData`. `rawData ?? []` only handles null/undefined; a truthy non-array would throw in `records.map`. Hoist `Array.isArray(rawData)` so it guards both branches.
  • superset/mcp_service/chart/tool/update_chart.py - 1
    • Misleading gauge rebind guidance · Line 803-807
      The new conditional message distinguishes gauge from geographic charts, but the shared `details` still tells gauge users to provide "geographic/metric roles", which is misleading for a gauge (no geographic roles). Mirror the `message` conditional in `details` so gauge rebind guidance references a metric, not geographic roles.
  • superset-frontend/plugins/plugin-chart-country-map/src/regions.ts - 1
    • Ambiguous duplicate region name · Line 184-184
      UK data contains two entries named 'Halton' (GB-HAL line 184, GB-WRL line 321), faithfully mirroring uk.geojson. In `resolveRegion`, the 'name' format maps NAME_1 to a single code, so a user selecting `region_format: 'name'` with value 'Halton' hits the 'Ambiguous' throw and the region fails to render. Consider disambiguating the labels or documenting this limitation.
  • superset/mcp_service/chart/tool/get_chart_preview.py - 1
    • Duplicate geographic viz set · Line 472-476
      This inline set duplicates `GEOGRAPHIC_VIZ_TYPES` (query_result.py:228), which already enumerates exactly these three viz types and is used by `validate_geographic_query_result`. If a new geographic viz type is added to that constant, this block will silently stop blocking its Vega preview. Reuse the constant to keep the guard in sync.
  • superset-frontend/plugins/plugin-chart-world-map/src/transformData.ts - 2
    • Untranslated error strings · Line 71-90
      The three new error messages (lines 74, 84, 88) are user-facing but hardcoded English strings. Wrap them in `t()` (imported from `@apache-superset/core/translation`, as `plugin-chart-echarts` does) so they participate in localization. This keeps the chart consistent with the repo's i18n conventions.
    • Redundant Number coercion · Line 87-87
      The loop at lines 78-86 already validates `record[secondaryLabel]` is a finite number, so the `Number()` coercion here is redundant. If that validation is ever relaxed, this coercion would silently accept numeric strings (e.g. "5"), diverging from the strict contract. Use `record[secondaryLabel] < 0` directly.
  • superset/utils/geographic_regions.py - 1
    • Ambiguous duplicate region name · Line 188-188
      The UK list contains two entries both named "Halton" (GB-HAL line 188, GB-WRL line 325). `resolve_geographic_value` treats a folded name matching two codes as ambiguous and raises ValueError, so `region_format="name"` can never resolve "Halton". This mirrors the frontend geojson (two Halton features), so it is faithful data, but it is an undocumented user-facing limitation. Consider noting it in the module docstring.
  • superset/mcp_service/chart/ascii_charts.py - 1
    • Geographic branch bypasses clamp/handling · Line 41-45
      This new branch sits before the `try/except` and before `width = max(width, 21)`, so it calls `generate_ascii_table(data, width)` with the unclamped width and is not protected by the exception handling that guards the identical fallback at line 65. Consider moving it inside the `try` block after the clamp for consistency.
Review Details
  • Files reviewed - 34 · Commit Range: d15f209..d15f209
    • docs/admin_docs/configuration/mcp-server.mdx
    • superset-frontend/plugins/plugin-chart-country-map/src/CountryMap.ts
    • superset-frontend/plugins/plugin-chart-country-map/src/controlPanel.ts
    • superset-frontend/plugins/plugin-chart-country-map/src/normalizeRegions.ts
    • superset-frontend/plugins/plugin-chart-country-map/src/regions.ts
    • superset-frontend/plugins/plugin-chart-country-map/src/transformProps.ts
    • superset-frontend/plugins/plugin-chart-country-map/test/geographicRendering.test.tsx
    • superset-frontend/plugins/plugin-chart-country-map/test/normalizeRegions.test.ts
    • superset-frontend/plugins/plugin-chart-country-map/test/transformProps.test.ts
    • superset-frontend/plugins/plugin-chart-world-map/src/transformData.ts
    • superset-frontend/plugins/plugin-chart-world-map/src/transformProps.ts
    • superset-frontend/plugins/plugin-chart-world-map/test/transformData.test.ts
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.test.ts
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts
    • superset/mcp_service/chart/ascii_charts.py
    • superset/mcp_service/chart/chart_helpers.py
    • superset/mcp_service/chart/chart_utils.py
    • superset/mcp_service/chart/compile.py
    • superset/mcp_service/chart/plugins/__init__.py
    • superset/mcp_service/chart/plugins/geographic.py
    • superset/mcp_service/chart/preview_utils.py
    • superset/mcp_service/chart/query_result.py
    • superset/mcp_service/chart/resources/chart_configs.py
    • superset/mcp_service/chart/schemas.py
    • superset/mcp_service/chart/tool/generate_chart.py
    • superset/mcp_service/chart/tool/get_chart_data.py
    • superset/mcp_service/chart/tool/get_chart_preview.py
    • superset/mcp_service/chart/tool/get_chart_type_schema.py
    • superset/mcp_service/chart/tool/update_chart.py
    • superset/mcp_service/chart/tool/update_chart_preview.py
    • superset/mcp_service/explore/tool/generate_explore_link.py
    • superset/utils/geographic.py
    • superset/utils/geographic_regions.py
    • tests/unit_tests/mcp_service/chart/test_geographic_chart.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

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

  • /review - Manually triggers an incremental AI Review.

  • /review full - 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@github-actions github-actions Bot added doc Namespace | Anything related to documentation plugins labels Sep 10, 2026
@netlify

netlify Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit bdbec9c
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6ac9ba53b681f0000807419e
😎 Deploy Preview https://deploy-preview-44148--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.67750% with 64 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.90%. Comparing base (1267bd1) to head (743d8d8).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
superset/mcp_service/chart/plugins/geographic.py 84.52% 26 Missing and 28 partials ⚠️
superset/mcp_service/chart/schemas.py 90.12% 4 Missing and 4 partials ⚠️
superset/utils/geographic.py 92.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #44148      +/-   ##
==========================================
+ Coverage   82.85%   82.90%   +0.05%     
==========================================
  Files        3017     3024       +7     
  Lines      192909   193634     +725     
  Branches    44974    45167     +193     
==========================================
+ Hits       159836   160537     +701     
+ Misses      30034    30025       -9     
- Partials     3039     3072      +33     
Flag Coverage Δ
hive 35.26% <27.25%> (-0.05%) ⬇️
javascript 78.65% <100.00%> (+0.03%) ⬆️
mysql 53.57% <27.25%> (-0.15%) ⬇️
postgres 53.58% <27.25%> (-0.15%) ⬇️
presto 37.08% <27.25%> (-0.06%) ⬇️
python 86.54% <88.88%> (+0.04%) ⬆️
sqlite 53.33% <27.25%> (-0.15%) ⬇️
unit 80.23% <88.88%> (+0.08%) ⬆️

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.

@aminghadersohi

Copy link
Copy Markdown
Contributor Author

Validation update for exact head 63954ec: 12 required checks pass. The remaining unit-tests-required gate fails because the Python job reaches its 30-minute timeout during the separate SQL coverage step. Both attempts passed the main suite: 15,248 passed, 5 skipped, 2 xfailed. One retry was made after inspecting the timeout; there were no assertion failures to fix, and I have not changed unrelated workflow limits. CI logs. Local focused MCP, frontend rendering, type/lint, and pre-commit validation remain passing. The PR body records this unresolved CI blocker and the lack of live deployment visual verification.

@aminghadersohi

aminghadersohi commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor Author

CI budget follow-up in 9f8983f: inspected both attempts of run 34512219179. The main suite passed in 1,580.07s and 1,611.40s; setup/coverage finalization left too little of the 30-minute job budget for the independent SQL and semantic-layer 100% gates. Current master still has 30 minutes. This uses the identical 40-minute budget/comment already shared by #43770 and #43771 (those PRs are open, not landed); the landed Gauge follow-up contains no timeout change. A parsed-workflow comparison confirms every test, coverage threshold, and upload step is unchanged.

Also reused the compiled chart union adapter in the new tests while retaining fresh model instances, with three isolation regression cases. Coverage-instrumented focused runs: 167 tests in 58.22s before, 170 in 57.36s after—only a small improvement, not enough to solve the shared job budget. Pre-commit including MyPy/Ruff/workflow audit passed; explicit Pylint scored 10/10. Fresh exact-head CI is running. No actionable review comments were present when refetched.

@github-actions github-actions Bot added the github_actions Pull requests that update GitHub Actions code label Sep 10, 2026
@aminghadersohi

Copy link
Copy Markdown
Contributor Author

Follow-up complete: all 13 required checks are green on 9f8983f8df5ce3e17dc54de20fe1f9851d282363.

Python CI run completed in 33m03s, confirming the old 30-minute budget was insufficient:

  • Main suite: 15,270 passed, 5 skipped, 2 xfailed.
  • SQL gate: 1,717 passed, 100.00% coverage.
  • Semantic-layer gate: 437 passed, 100.00% coverage.
  • Coverage upload succeeded; all commands and thresholds remain unchanged.

Local exact-head validation: 4,134 MCP tests passed, 1 skipped; focused geographic coverage run 170 passed; full branch pre-commit/MyPy/Ruff/Pylint checks passed. No retries were needed on this head. Reviews and inline comments were refetched at completion; no actionable feedback was present. This supersedes the earlier timeout-blocked status.

@aminghadersohi

Copy link
Copy Markdown
Contributor Author

Maintainer follow-up in 7975e11: merged upstream 39944ff normally. The documentation conflict retained both geographic generation and dataset/nested-field guidance; upstream forwarded-filter behavior and all geographic paths remain covered.

Response to the additional suggestions in the review report:

  • Fixed typed world-map non-array input handling with an actionable translated error and four malformed-result regressions. Translated world metric/country errors and removed redundant numeric coercion.
  • Moved geographic ASCII rendering inside the common clamp/error boundary; regression cases cover all three map types at negative width and table-render failure.
  • Preserved temporal recommendations ahead of geographic heuristics, excluded boolean identifiers, and bounded identifier cardinality. Regression tests cover each condition; these remain recommendations, not inferred geographic validity.
  • Cached immutable world-country aliases by format and indexed country-map exact/folded aliases once per transform. Added cache/format-isolation and duplicate-name regressions; existing case-safe ambiguity/parity tests still pass.
  • Corrected Gauge rebind guidance, preserving the native Gauge wording; public FastMCP tests verify Gauge and all geographic rebind errors. Consolidated preview-type guards, compile error codes, and cross-filter/drill source lookup. Added the deferred-import explanation.
  • Retained strict finite metrics and frontend validation intentionally: saved Explore/dashboard renders can query new data without invoking MCP compile. Silently accepting missing/null metrics or removing client validation would violate the strict typed contract. Legacy maps without the typed opt-in retain their existing behavior.
  • Retained the bounded five-country contract rather than advertising unimplemented normalization. Duplicate bundled UK Halton names are deliberately rejected; documentation and Python/TypeScript regressions demonstrate using GB-HAL or WRL instead. We do not guess or silently relabel the bundled geometry.
  • The reported record-property reads do not mutate prototypes; the numeric checks reject nonnumeric inherited members. No prototype-pollution write or security-boundary violation was identified, so no speculative security fix was added.

Validation: 4,162 MCP tests passed, 2 skipped; 180 focused geographic tests passed; 181 frontend tests passed across 16 suites; native plugin TypeScript builds and full branch pre-commit/MyPy/Ruff/Pylint/type/lint checks passed. Exact-head CI is pending. There were no inline review threads to resolve; none were marked resolved.

@aminghadersohi

Copy link
Copy Markdown
Contributor Author

Finite maintainer pass complete: all 13 required checks are green on 7975e116e9b7d63bcc52eb36f9451183cd415cae. The PR is ready for review and mergeable; it has not been merged.

  • Python CI: 15,288 passed, 5 skipped, 2 xfailed. Independent SQL (1,717 tests) and semantic-layer (437 tests) gates both reached 100.00% coverage.
  • Browser CI retry passed. The only retry followed a verified pre-test infrastructure failure: Chrome's package index had an unexpected size (1409 versus 1412 bytes, mirror synchronization). No test assertions or coverage thresholds were weakened.
  • Local validation: 4,162 MCP tests, 180 focused geographic tests, 181 frontend tests, native TypeScript builds, and full branch pre-commit/type/lint checks passed.
  • Reviews, issue comments, and threads were refetched at completion. The additional suggestions are addressed or explained in the evidence reply; no inline threads existed, so none were resolved.

Tracking linkage is preserved. The branch was updated through a normal upstream merge and normal push; the worktree is clean.

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #51cfc3

Actionable Suggestions - 1
  • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts - 1
Review Details
  • Files reviewed - 5 · Commit Range: 4f08115..696f569
    • docs/admin_docs/configuration/mcp-server.mdx
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.test.ts
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts
    • superset/mcp_service/chart/chart_utils.py
    • tests/unit_tests/mcp_service/chart/test_geographic_chart.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

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

  • /review - Manually triggers an incremental AI Review.

  • /review full - 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

@bito-code-review

bito-code-review Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #a48c10

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 696f569..cd72c06
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/buildQuery.ts
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

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

  • /review - Manually triggers an incremental AI Review.

  • /review full - 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

A saved map with granularity_sqla and a bounded time_range lost its time
filter after an update omitting temporal controls, because the typed
Scatter query and the shared map query never bound the legacy time
column. Bind granularity_sqla (or a dashboard granularity override) in
all geographic queries while typed points still skip time bucketing.
@bito-code-review

bito-code-review Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #7cf8cb

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: cd72c06..f1a5f67
    • superset/mcp_service/chart/plugins/geographic.py
    • tests/unit_tests/mcp_service/chart/test_geographic_chart.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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 an incremental AI Review.

  • /review full - 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread superset/mcp_service/chart/schemas.py Resolved
…andling

- Reject a deck_scatter dimension that reuses a coordinate column.
- Require exact boundary ISO codes for the legacy country-map format.
- Normalize a preserved numeric-string radius to an explicit fixed radius
  on typed updates, and apply the same rule in Scatter buildQuery.
- Strengthen the full-bounded-result test with two valid rows first.
Supply the security-manager access decision for geographic tool fixtures so the target-dataset check added on master uses the same controlled access as sibling entry points. Assert that rebinds check the dataset without bypassing the production auth helper.

@bito-code-review bito-code-review Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Agent Run #5bf46d

Actionable Suggestions - 3
  • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/buildQuery.ts - 1
  • superset/utils/geographic.py - 2
    • Boolean flag over explicit mode enum · Line 40-40
    • Parameter shadows deleted set name · Line 53-53
Additional Suggestions - 3
  • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/buildQuery.test.ts - 2
    • Inconsistent test title prefix · Line 548-548
      Every other test in `buildQuery.test.ts` titles itself 'Scatter buildQuery …' (28 occurrences, e.g. lines 505, 519); this new test at line 548 says 'native buildQuery', a term this file never uses elsewhere. Aligning the title keeps the suite's naming convention consistent and grep-friendly.
    • Missing falsy-flag test case · Line 534-546
      This `test.each` only exercises `mcp_geographic: true`. The negative branch — `getTypedFixedRadius` returning `null` when the flag is falsy, so the numeric-string stays a saved metric — is asserted only for the default (no-flag) form at line 548, never for `mcp_geographic: false`/`undefined`, which `transformProps.test.ts:602` does cover. Add those cases so the flag's falsy values are pinned here too.
  • superset/mcp_service/chart/plugins/geographic.py - 1
    • Signature drift from base hook · Line 646-646
      The base hook `BaseChartPlugin.validate_merged_form_data` (`plugin.py:331`) types `dataset_context` as `Callable[[], Any] | None`; this override widens it to `Any`. The preview caller (`update_chart_preview.py:280-285`) already passes a lambda, so behavior is unchanged today, but the drifted annotation defeats static checking for future callers. Aligning the type is a two-line change.
Review Details
  • Files reviewed - 8 · Commit Range: f1a5f67..e97884a
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/buildQuery.test.ts
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/buildQuery.ts
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts
    • superset/mcp_service/chart/plugins/geographic.py
    • superset/mcp_service/chart/schemas.py
    • superset/utils/geographic.py
    • tests/unit_tests/mcp_service/chart/test_geographic_chart.py
    • docs/admin_docs/configuration/mcp-server.mdx
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

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

  • /review - Manually triggers an incremental AI Review.

  • /review full - 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

Comment thread superset/utils/geographic.py Resolved
Comment thread superset/utils/geographic.py Resolved
@bito-code-review

bito-code-review Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #212366

Actionable Suggestions - 0
Review Details
  • Files reviewed - 5 · Commit Range: e97884a..fbabce0
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/buildQuery.ts
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts
    • superset-frontend/plugins/preset-chart-deckgl/src/layers/utils/metricUtils.ts
    • superset/mcp_service/chart/plugins/geographic.py
    • superset/utils/geographic.py
  • Files skipped - 0
  • Tools
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ Successful
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • Eslint (Linter) - ✔︎ Successful

Bito Usage Guide

Commands

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

  • /review - Manually triggers an incremental AI Review.

  • /review full - 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 [email protected].

Documentation & Help

AI Code Review powered by Bito Logo

…t-types

# Conflicts:
#	docs/admin_docs/configuration/mcp-server.mdx
Comment thread superset/mcp_service/chart/schemas.py Resolved
@aminghadersohi

Copy link
Copy Markdown
Contributor Author

@villebro @rusackas @sha174n @p2er this is approved by @sadpandajoe and @rebenitez1802 and waiting on a code owner stamp (it touches the country-map plugin). Could one of you take a look when you get a chance? Thanks!

Reconcile the geographic chart plugins with master's shared query-context
and update-merge refactor:

- Build Deck.gl layer queries through the shared frontend-equivalent adapter
- Declare geographic query-role keys and own the same-viz update merge
- Apply explicit time overrides on conversions via finalize_update_form_data
- Keep disabled types editable only in place across update entry points
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc Namespace | Anything related to documentation i18n:brazilian i18n:chinese Translation related to Chinese language i18n:czech i18n:dutch i18n:french Translation related to French language i18n:italian Translation related to Italian language i18n:japanese Translation related to Japanese language i18n:korean Translation related to Korean language i18n:latvian i18n:persian i18n:portuguese i18n:russian Translation related to Russian language i18n:slovak i18n:spanish Translation related to Spanish language i18n:traditional-chinese i18n:ukrainian i18n Namespace | Anything related to localization packages plugins risk:chart-metadata size/XXL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants