feat(mcp): add series_limit to generate_chart XY config#40307
Draft
aminghadersohi wants to merge 2 commits into
Draft
feat(mcp): add series_limit to generate_chart XY config#40307aminghadersohi wants to merge 2 commits into
aminghadersohi wants to merge 2 commits into
Conversation
Add series_limit parameter to XYChartConfig so callers can control how many distinct series (group_by values) the chart renders. When set, the value is forwarded as form_data["series_limit"], which Superset's echarts timeseries plugins interpret to cap the number of rendered series lines/bars.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40307 +/- ##
==========================================
- Coverage 64.18% 64.18% -0.01%
==========================================
Files 2591 2591
Lines 138455 138460 +5
Branches 32118 32119 +1
==========================================
+ Hits 88871 88873 +2
- Misses 48052 48055 +3
Partials 1532 1532
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Extract row/series limit assignment into a private helper to keep map_xy_config within the McCabe complexity threshold, removing the noqa: C901 suppression. Move series_limit schema tests out of TestRowLimit and into a dedicated TestSeriesLimit class. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Adds a
series_limitparameter toXYChartConfigin thegenerate_chartMCP tool.When
group_byis set on an XY chart (line, bar, area, scatter), users can now control the maximum number of distinct series rendered by specifyingseries_limit. The value is forwarded asform_data["series_limit"], which Superset's echarts timeseries plugins use to cap the number of rendered series lines/bars.Usage example:
{ "dataset_id": 123, "config": { "chart_type": "xy", "x": {"name": "order_date"}, "y": [{"name": "revenue", "aggregate": "SUM"}], "group_by": [{"name": "region"}], "kind": "line", "series_limit": 10 } }When
series_limitis not set (defaultNone), the field is omitted from form_data and Superset applies no series cap.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — backend schema change only.
TESTING INSTRUCTIONS
generate_chartwith an XY config that includesgroup_byandseries_limit: 5form_datacontains"series_limit": 5series_limit— verifyform_datadoes not containseries_limitADDITIONAL INFORMATION