Repository navigation
feat(mcp): add get_dashboard_data for bounded, filter-aware dashboard data - #44113
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #44113 +/- ##
==========================================
+ Coverage 80.18% 80.19% +0.01%
==========================================
Files 2925 2926 +1
Lines 172692 172817 +125
Branches 40090 40101 +11
==========================================
+ Hits 138474 138598 +124
Misses 31623 31623
- Partials 2595 2596 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
c45af2b to
5b988a5
Compare
4f2e5d5 to
ec8dce0
Compare
Code Review Agent Run #5312ffActionable Suggestions - 0Additional Suggestions - 3
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
EnxDev
left a comment
There was a problem hiding this comment.
Thanks for making the dashboard-wide path bounded and resilient per chart—the layout ordering and partial-error handling are thoughtful. I found three cases that need another pass before this is safe to rely on for analysis: the composed tool skips the Chart permission/scope gate, multi-query charts lose every layer after the first, and capped row counts are presented as full totals. I left concrete suggestions inline. I ran the dashboard and chart MCP unit suites together: 137 passed.
ec8dce0 to
8c3ac71
Compare
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Code Review Agent Run #ce1f8bActionable Suggestions - 0Additional Suggestions - 4
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
EnxDev
left a comment
There was a problem hiding this comment.
Thanks for the quick follow-up. I verified that the Chart permission gate is restored, multi-query layers are preserved, and capped results now carry an explicit truncation signal. One count-contract edge remains: known source totals are overwritten when the returned row count is below the fetch cap, which can still make the dashboard summary undercount. I also noted the user/operator documentation that needs to move with this new guest-visible API. I ran the dashboard and chart MCP unit suites together on the updated head: 141 passed.
8c3ac71 to
6303eb4
Compare
6303eb4 to
73e4f0b
Compare
Code Review Agent Run #309886Actionable Suggestions - 0Additional Suggestions - 7
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
EnxDev
left a comment
There was a problem hiding this comment.
Thanks for addressing the previous pass. I verified the known-total regression, per-layer totals, boolean identifier guard, guest allow-list documentation, dual-permission documentation, and user-facing tool catalog. The authorization composition also remains aligned with Superset’s published security model. One production-shaped cap case still needs adjustment: the upstream rowcount is calculated after the imposed query limit, so equality with the cap is not an authoritative full total. I left that case inline. Focused dashboard and chart MCP suites pass: 143 tests.
73e4f0b to
08e6916
Compare
EnxDev
left a comment
There was a problem hiding this comment.
Thanks for the careful follow-through. I verified the latest cap-handling fix: an upstream count equal to the imposed limit is treated as unknown, while a genuine larger total is preserved, and the production-shaped regression covers it. The earlier Chart permission, multi-query, count-contract, and documentation concerns are all addressed. I also rechecked the guest authorization path against Superset’s security model and found no remaining issues. Focused dashboard and chart MCP suites pass: 148 tests. Approving; a few repository-wide required CI jobs are still running.
Code Review Agent Run #3c49f1Actionable Suggestions - 0Additional Suggestions - 6
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
aminghadersohi
left a comment
There was a problem hiding this comment.
unit-tests-required is red only because unit-tests (current) hit the 30-min cap during the coverage step — the Python unit tests step itself passed. Rebasing picks up #44178 (xdist) and should clear it.
… data Returns compact, filter-aware data across a dashboard's charts in one call so an agent can answer analytical questions about a whole dashboard without fetching each chart separately. Reuses get_chart_data's query and guest-authorization path (extracted into a shared execute_chart_data), selects charts in layout reading order, bounds output by max_charts plus a soft time budget, and returns compact per-chart columns, sample rows, and row counts.
08e6916 to
a3f9cd0
Compare
Code Review Agent Run #2bb152Actionable Suggestions - 0Additional Suggestions - 2
Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
#44435's test called module.execute_chart_data, the undecorated core that master's #44113 (never backported -- it's the feat that added get_dashboard_data) split out of the @tool-wrapped get_chart_data. 7.0 only has the decorated function, which needs a live FastMCP Client context to run at all. The fix itself is still covered by this file's other four tests, which exercise dashboard_filter_context.py and time_grain_utils.py directly.
SUMMARY
Adds a new MCP tool
get_dashboard_datathat returns compact, filter-aware data across a dashboard's charts in a single call, so an AI agent can answer analytical questions about a whole dashboard without fetching each chart separately.get_chart_data's query and guest-authorization path: its body is extracted into a shared, undecoratedexecute_chart_data, andget_chart_databecomes a thin wrapper (behavior unchanged).applied_filters(keyed by chart id), so answers reflect the filtered view.max_chartsplus a soft time budget so a large or slow dashboard degrades gracefully instead of stalling; per-chart errors are surfaced, not fatal.ChartDataCommandpath (no raw SQL), withraise_for_accessintact on both dashboard resolution and each chart query, and added toMCP_GUEST_ALLOWED_TOOLS.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A (MCP tool, no UI).
TESTING INSTRUCTIONS
pytest tests/unit_tests/mcp_service/dashboard/tool/test_get_dashboard_data.pyget_dashboard_data(request={"identifier": <dashboard id>})returns per-chart columns, sample rows, and counts in layout order, bounded bymax_charts.ADDITIONAL INFORMATION