Skip to content

fix(mcp): point get_dataset_info url to explore view instead of legacy tablemodelview edit - #39838

Merged
aminghadersohi merged 2 commits into
apache:masterfrom
aminghadersohi:aminghadersohi/fix-dataset-mcp-explore-url
May 4, 2026
Merged

fix(mcp): point get_dataset_info url to explore view instead of legacy tablemodelview edit#39838
aminghadersohi merged 2 commits into
apache:masterfrom
aminghadersohi:aminghadersohi/fix-dataset-mcp-explore-url

Conversation

@aminghadersohi

Copy link
Copy Markdown
Contributor

SUMMARY

The get_dataset_info MCP tool was returning a url field pointing to /tablemodelview/edit/{id} — the legacy Flask-AppBuilder admin edit endpoint. This is not a useful user-facing URL.

The URL now points to the Explore view: /explore/?datasource_type=table&datasource_id={id}, which is the standard user-facing entry point for interacting with a dataset. This matches the pattern used by the chart info tool (/explore/?slice_id={id}) and the explore link generation utilities in the MCP service.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A — URL string change only.

TESTING INSTRUCTIONS

  1. Start Superset with the MCP service enabled.
  2. Call get_dataset_info with a valid dataset ID via the MCP client.
  3. Verify the returned url field contains /explore/?datasource_type=table&datasource_id={id} rather than /tablemodelview/edit/{id}.

ADDITIONAL INFORMATION

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

@codecov

codecov Bot commented May 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.37%. Comparing base (dc1c0f6) to head (66209ba).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #39838      +/-   ##
==========================================
+ Coverage   64.35%   64.37%   +0.01%     
==========================================
  Files        2569     2569              
  Lines      134680   134684       +4     
  Branches    31254    31255       +1     
==========================================
+ Hits        86679    86707      +28     
+ Misses      46505    46479      -26     
- Partials     1496     1498       +2     
Flag Coverage Δ
hive 39.67% <100.00%> (?)
mysql 59.94% <100.00%> (-0.01%) ⬇️
postgres 60.02% <100.00%> (-0.01%) ⬇️
presto 41.42% <100.00%> (-0.01%) ⬇️
python 61.55% <100.00%> (+0.04%) ⬆️
sqlite 59.64% <100.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.

@aminghadersohi
aminghadersohi marked this pull request as ready for review May 4, 2026 13:57
@dosubot dosubot Bot added the explore Namespace | Anything related to Explore label May 4, 2026
@bito-code-review

bito-code-review Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #86f22e

Actionable Suggestions - 0
Review Details
  • Files reviewed - 2 · Commit Range: c6c1afd..c6c1afd
    • superset/mcp_service/dataset/schemas.py
    • tests/unit_tests/mcp_service/dataset/tool/test_dataset_tools.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

@richardfogaca richardfogaca 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.

Posting on Richard's behalf - this is his PR reviewer agent. Forward any pushback to him and he'll loop me back in.

Left one small test-coverage suggestion below. The URL behavior itself looks directionally right to me, and all line numbers are verified against HEAD c6c1afd.

Other suggestion

  • tests/unit_tests/mcp_service/dataset/tool/test_dataset_tools.py:994

    This fixture now sets the mock dataset URL to the Explore route, but serialize_dataset_object builds the returned url from get_superset_base_url() and dataset.id rather than from dataset.url. That means the focused get_dataset_info test could still pass if the serializer regressed back to /tablemodelview/edit/....

    Small suggestion: would it be worth patching get_superset_base_url in test_get_dataset_info_success and asserting data["url"] equals the full Explore URL? Happy to keep as-is if you think the existing coverage elsewhere is enough.

Praise

  • superset/mcp_service/dataset/schemas.py:710

    Nice alignment with the existing MCP Explore-link shape for datasets. Returning the user-facing Explore route here feels much more useful than sending clients to the legacy FAB edit view.

@aminghadersohi

Copy link
Copy Markdown
Contributor Author

Thanks @richardfogaca! Good catch — the fixture was setting dataset.url but serialize_dataset_object never reads that attribute; it constructs the URL itself from get_superset_base_url() and dataset.id. So the test gave false confidence.

Done in 66209ba: patched get_superset_base_url to return http://test-superset and added an explicit assertion that data["url"] == "http://test-superset/explore/?datasource_type=table&datasource_id=1". The test will now fail if the serializer regresses back to the legacy endpoint.

@richardfogaca richardfogaca 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.

LGTM 💯

@bito-code-review

bito-code-review Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #d294f3

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: c6c1afd..66209ba
    • tests/unit_tests/mcp_service/dataset/tool/test_dataset_tools.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

@aminghadersohi
aminghadersohi merged commit 673634f into apache:master May 4, 2026
69 of 71 checks passed
bestlong pushed a commit to bestlong/superset that referenced this pull request May 7, 2026
qfcwell pushed a commit to qfcwell/superset that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

explore Namespace | Anything related to Explore size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants