Skip to content

fix(mcp): support dashboard owner filters#40532

Draft
richardfogaca wants to merge 1 commit into
apache:masterfrom
richardfogaca:rch-77-mcp-list_dashboards-owner-filter-not-supported
Draft

fix(mcp): support dashboard owner filters#40532
richardfogaca wants to merge 1 commit into
apache:masterfrom
richardfogaca:rch-77-mcp-list_dashboards-owner-filter-not-supported

Conversation

@richardfogaca
Copy link
Copy Markdown
Contributor

SUMMARY

list_dashboards accepted only scalar dashboard filters in its MCP request schema, so an owner relationship filter such as owners + rel_m_m failed Pydantic validation before dashboard listing could run.

What Changed

This change:

  • Adds owners and created_by to the dashboard MCP filter schema with their relationship operators.
  • Validates relationship operators against the dashboard DAO custom field/operator contract so scalar filters such as dashboard_title still reject relationship-only operators.
  • Handles owner and creator relationship filters in superset/daos/dashboard.py while preserving existing dashboard-specific favorite/current-user handling and generic scalar filter delegation.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A - backend/MCP request validation change with API-level verification.

Reviewer Focus

The main review risk is keeping relationship operators scoped to relationship fields while avoiding a second hard-coded operator table in the MCP schema. The schema checks the dashboard DAO custom field/operator contract, and generic scalar filters continue through the existing base DAO path.

TESTING INSTRUCTIONS

Validation

  • Live MCP/API validation in a local Superset compose runtime: started the MCP streamable HTTP server from the Superset API container and posted JSON-RPC tools/call requests to list_dashboards. The reproduced owners + rel_m_m request returned HTTP 200 and reached the authentication boundary instead of Validation error in list_dashboards, confirming the reported validation rejection is gone.
  • Live MCP/API validation in the same local runtime: posted created_by + rel_o_m to list_dashboards; the response also reached the authentication boundary instead of schema rejection, confirming the creator relationship variant is accepted.
  • Live MCP/API validation in the same local runtime: posted the adversarial scalar filter dashboard_title + rel_m_m; the response returned Validation error in list_dashboards with an unsupported operator/column message, confirming relationship operators were not broadened to scalar fields.
  • Focused regression check: pytest -q tests/unit_tests/mcp_service/dashboard/tool/test_dashboard_tools.py tests/unit_tests/dashboards/dao_tests.py

ADDITIONAL INFORMATION

  • Has associated issue: N/A - tracked internally
  • Required feature flags: N/A
  • 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

@github-actions
Copy link
Copy Markdown
Contributor

Congrats on making your first PR and thank you for contributing to Superset! 🎉 ❤️

Please read our New Contributor Welcome & Expectations guide.

We hope to see you in our Slack community too! Not signed up? Use our Slack App to self-register.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 29, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 9818c4f
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6a1a2591493ad50008a2516e
😎 Deploy Preview https://deploy-preview-40532--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.

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