Skip to content

chore(mcp): Standardize error response shapes across chart tools#39905

Open
alexandrusoare wants to merge 1 commit intomasterfrom
alexandrusoare/chore/standardize_chart_error_response
Open

chore(mcp): Standardize error response shapes across chart tools#39905
alexandrusoare wants to merge 1 commit intomasterfrom
alexandrusoare/chore/standardize_chart_error_response

Conversation

@alexandrusoare
Copy link
Copy Markdown
Contributor

SUMMARY

Chart tools return two different error shapes — ChartError has an error field while ChartGenerationError uses message. Clients need to check different field names just to read the error message depending on which tool they called.

This PR introduces MCPBaseError as a shared base class. Both ChartError and ChartGenerationError now inherit from it, so every chart error response includes both error and message fields (same value), plus consistent optional fields like details and suggestions.

Existing code is fully backward compatible — no call sites were changed.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

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

@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 6, 2026

Code Review Agent Run #742d19

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: 491bc0a..491bc0a
    • superset/mcp_service/chart/schemas.py
    • superset/mcp_service/common/error_schemas.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful
    • MyPy (Static Code Analysis) - ✔︎ Successful
    • Astral Ruff (Static Code Analysis) - ✔︎ 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

@dosubot dosubot Bot added the change:backend Requires changing the backend label May 6, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented May 6, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 491bc0a
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69faf81614f4be0009c46cb1
😎 Deploy Preview https://deploy-preview-39905--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
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 84.61538% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.88%. Comparing base (d618837) to head (491bc0a).
⚠️ Report is 20 commits behind head on master.

Files with missing lines Patch % Lines
superset/mcp_service/common/error_schemas.py 81.81% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #39905      +/-   ##
==========================================
- Coverage   64.37%   63.88%   -0.49%     
==========================================
  Files        2569     2583      +14     
  Lines      134745   136671    +1926     
  Branches    31278    31513     +235     
==========================================
+ Hits        86737    87316     +579     
- Misses      46510    47839    +1329     
- Partials     1498     1516      +18     
Flag Coverage Δ
hive 39.39% <84.61%> (-0.29%) ⬇️
mysql 59.06% <84.61%> (-0.88%) ⬇️
postgres 59.13% <84.61%> (-0.89%) ⬇️
presto 41.09% <84.61%> (-0.34%) ⬇️
python 60.57% <84.61%> (-0.98%) ⬇️
sqlite 58.77% <84.61%> (-0.87%) ⬇️
unit 100.00% <ø> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Member

@msyavuz msyavuz left a comment

Choose a reason for hiding this comment

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

LGTM!

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

Labels

change:backend Requires changing the backend size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants