Skip to content

feat(mcp): make config optional in generate_explore_link#39559

Merged
msyavuz merged 2 commits into
masterfrom
feat/mcp-optional-explore-config
May 21, 2026
Merged

feat(mcp): make config optional in generate_explore_link#39559
msyavuz merged 2 commits into
masterfrom
feat/mcp-optional-explore-config

Conversation

@msyavuz
Copy link
Copy Markdown
Member

@msyavuz msyavuz commented Apr 22, 2026

SUMMARY

generate_explore_link required config as a mandatory field, forcing LLMs to construct a chart config even when the user just wants to open a dataset in Explore.

This PR makes config optional. When omitted, the tool validates the dataset exists and returns a default explore URL (/explore/?datasource_type=table&datasource_id=<id>) that opens the dataset in Superset with no preconfigured chart.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — backend-only MCP tool change, no UI.

TESTING INSTRUCTIONS

Unit tests:

pytest tests/unit_tests/mcp_service/explore/tool/test_generate_explore_link.py

Manual (via MCP client):

  • Call generate_explore_link with {"dataset_id": 1} — should return a dataset explore URL with no form_data.
  • Call with {"dataset_id": 99999} (nonexistent) — should return a dataset-not-found error.
  • Call with a valid config — should behave exactly as before.

ADDITIONAL INFORMATION

  • Has associated issue: No
  • Required feature flags: None
  • Changes UI: No — backend-only
  • Includes DB Migration: No
  • Introduces new feature or API: No — relaxes an existing required field
  • Removes existing feature or API: No — backwards-compatible (existing callers with config are unaffected)

Allow callers to omit the chart config and get a default explore URL
that opens the dataset in Superset without a preconfigured chart. This
removes the need to construct a chart config when the user just wants
to explore a dataset.
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented Apr 22, 2026

Code Review Agent Run #6cde5c

Actionable Suggestions - 0
Review Details
  • Files reviewed - 3 · Commit Range: f2d4e9c..f2d4e9c
    • superset/mcp_service/chart/schemas.py
    • superset/mcp_service/explore/tool/generate_explore_link.py
    • tests/unit_tests/mcp_service/explore/tool/test_generate_explore_link.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 Apr 22, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 10.00000% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.69%. Comparing base (2f5fcc2) to head (7b2973b).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
.../mcp_service/explore/tool/generate_explore_link.py 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #39559      +/-   ##
==========================================
- Coverage   64.18%   63.69%   -0.50%     
==========================================
  Files        2592     2584       -8     
  Lines      138723   137052    -1671     
  Branches    32175    31504     -671     
==========================================
- Hits        89045    87299    -1746     
- Misses      48146    48221      +75     
  Partials     1532     1532              
Flag Coverage Δ
hive 39.36% <10.00%> (-0.01%) ⬇️
mysql 58.92% <10.00%> (-0.01%) ⬇️
postgres 59.01% <10.00%> (-0.01%) ⬇️
presto 41.03% <10.00%> (-0.01%) ⬇️
python 60.57% <10.00%> (-0.01%) ⬇️
sqlite 58.64% <10.00%> (-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 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.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 22, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit f2d4e9c
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/69e8a1361219c20008db606d
😎 Deploy Preview https://deploy-preview-39559--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

Copy link
Copy Markdown
Contributor

@EnxDev EnxDev left a comment

Choose a reason for hiding this comment

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

LGTM!

@EnxDev EnxDev added the hold:testing! On hold for testing label Apr 22, 2026
@msyavuz msyavuz removed the hold:testing! On hold for testing label May 20, 2026
…xplore-config

# Conflicts:
#	superset/mcp_service/chart/schemas.py
#	superset/mcp_service/explore/tool/generate_explore_link.py
@msyavuz msyavuz merged commit 4c3f65e into master May 21, 2026
79 of 80 checks passed
@msyavuz msyavuz deleted the feat/mcp-optional-explore-config branch May 21, 2026 15:02
sha174n pushed a commit to sha174n/superset that referenced this pull request May 22, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

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 preset-io size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants