Skip to content

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

Open
msyavuz wants to merge 1 commit intomasterfrom
feat/mcp-optional-explore-config
Open

feat(mcp): make config optional in generate_explore_link#39559
msyavuz wants to merge 1 commit intomasterfrom
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 0% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.45%. Comparing base (fbd0621) to head (f2d4e9c).
⚠️ Report is 55 commits behind head on master.

Files with missing lines Patch % Lines
.../mcp_service/explore/tool/generate_explore_link.py 0.00% 9 Missing ⚠️
superset/mcp_service/chart/schemas.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #39559      +/-   ##
==========================================
- Coverage   64.49%   64.45%   -0.04%     
==========================================
  Files        2557     2561       +4     
  Lines      133191   133390     +199     
  Branches    30935    30969      +34     
==========================================
+ Hits        85897    85975      +78     
- Misses      45804    45923     +119     
- Partials     1490     1492       +2     
Flag Coverage Δ
hive 39.86% <0.00%> (-0.01%) ⬇️
mysql 60.42% <0.00%> (-0.08%) ⬇️
postgres 60.50% <0.00%> (-0.08%) ⬇️
presto 41.64% <0.00%> (-0.02%) ⬇️
python 62.08% <0.00%> (-0.08%) ⬇️
sqlite 60.14% <0.00%> (-0.08%) ⬇️
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
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 hold:testing! On hold for testing preset-io size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants