Skip to content

fix(mcp): expose table column formatting - #42658

Draft
aminghadersohi wants to merge 1 commit into
apache:masterfrom
aminghadersohi:aminghadersohi/table-column-formatting
Draft

fix(mcp): expose table column formatting#42658
aminghadersohi wants to merge 1 commit into
apache:masterfrom
aminghadersohi:aminghadersohi/table-column-formatting

Conversation

@aminghadersohi

Copy link
Copy Markdown
Contributor

SUMMARY

Expose per-column table formatting in MCP chart configurations. Table configs can set columnWidth, d3NumberFormat, and d3TimeFormat, keyed by result column label, and the generated schema documents concrete D3 format examples.

Existing table column_config values are preserved when an update omits the field, while explicit values are validated and serialized without silently dropping unknown settings.

TESTING INSTRUCTIONS

pytest -q tests/unit_tests/mcp_service/chart/test_new_chart_types.py tests/unit_tests/mcp_service/chart/tool/test_get_chart_type_schema.py tests/unit_tests/mcp_service/chart/tool/test_update_chart.py tests/unit_tests/mcp_service/chart/tool/test_update_chart_preview.py
uvx pre-commit run --files superset/mcp_service/chart/chart_utils.py superset/mcp_service/chart/schemas.py superset/mcp_service/chart/tool/update_chart.py superset/mcp_service/chart/tool/update_chart_preview.py tests/unit_tests/mcp_service/chart/test_new_chart_types.py tests/unit_tests/mcp_service/chart/tool/test_get_chart_type_schema.py tests/unit_tests/mcp_service/chart/tool/test_update_chart.py tests/unit_tests/mcp_service/chart/tool/test_update_chart_preview.py

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration
  • Introduces new feature or API
  • Removes existing feature or API

BLAST RADIUS

Limited to MCP table chart configuration schemas and form-data mapping. It does not change authorization, database models, migrations, or non-MCP chart behavior.

RISK AND ROLLBACK

The main risk is accepting a formatting value that the frontend renders differently than expected. Validation constrains field names and primitive types, and rollback is a normal revert with no data migration.

REVIEW GUIDANCE

Start with TableColumnConfig in schemas.py, then review the form-data mapping and preservation paths in the two update tools.

EVAL EVIDENCE

The deterministic schema and round-trip paths are covered by 189 passing focused MCP unit tests. No model-based evaluation suite was available in this checkout.

COST AND LATENCY DELTA

No prompt, model, routing, or tool-call changes. The added local schema validation and dictionary serialization have negligible request cost and latency impact.

PROMPT / NON-DETERMINISM

No prompt or non-deterministic behavior changed.

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 31.57895% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.44%. Comparing base (035eaa8) to head (8d95b8f).
⚠️ Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
superset/mcp_service/chart/tool/update_chart.py 0.00% 7 Missing ⚠️
...set/mcp_service/chart/tool/update_chart_preview.py 0.00% 4 Missing ⚠️
superset/mcp_service/chart/chart_utils.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #42658      +/-   ##
==========================================
- Coverage   65.44%   65.44%   -0.01%     
==========================================
  Files        2810     2810              
  Lines      159366   159381      +15     
  Branches    36374    36379       +5     
==========================================
+ Hits       104302   104308       +6     
- Misses      53022    53031       +9     
  Partials     2042     2042              
Flag Coverage Δ
hive 38.09% <31.57%> (+<0.01%) ⬆️
mysql 57.82% <31.57%> (-0.01%) ⬇️
postgres 57.87% <31.57%> (-0.01%) ⬇️
presto 39.98% <31.57%> (ø)
python 59.25% <31.57%> (-0.01%) ⬇️
sqlite 57.49% <31.57%> (-0.01%) ⬇️
unit 100.00% <ø> (ø)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant