fix(mcp): support dashboard owner filters#40532
Draft
richardfogaca wants to merge 1 commit into
Draft
Conversation
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. |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
list_dashboardsaccepted only scalar dashboard filters in its MCP request schema, so an owner relationship filter such asowners+rel_m_mfailed Pydantic validation before dashboard listing could run.What Changed
This change:
ownersandcreated_byto the dashboard MCP filter schema with their relationship operators.dashboard_titlestill reject relationship-only operators.superset/daos/dashboard.pywhile 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
tools/callrequests tolist_dashboards. The reproducedowners+rel_m_mrequest returned HTTP 200 and reached the authentication boundary instead ofValidation error in list_dashboards, confirming the reported validation rejection is gone.created_by+rel_o_mtolist_dashboards; the response also reached the authentication boundary instead of schema rejection, confirming the creator relationship variant is accepted.dashboard_title+rel_m_m; the response returnedValidation error in list_dashboardswith an unsupported operator/column message, confirming relationship operators were not broadened to scalar fields.pytest -q tests/unit_tests/mcp_service/dashboard/tool/test_dashboard_tools.py tests/unit_tests/dashboards/dao_tests.pyADDITIONAL INFORMATION