fix(examples): replace deprecated groupby field with columns in example chart YAMLs - #43723
fix(examples): replace deprecated groupby field with columns in example chart YAMLs#43723eschutho wants to merge 2 commits into
Conversation
…le chart YAMLs The `groupby` -> `columns` field rename (superset/common/query_object.py::DEPRECATED_FIELDS) was already applied to birth_names/world_bank fixtures (apache#43468) and to two sibling deprecated fields elsewhere. This closes the gap for the remaining example dashboards (fcc_new_coder_survey, featured_charts, sales_dashboard, slack_dashboard, video_game_sales), scoped to the 5 viz_types (table, pie, echarts_timeseries_line, echarts_area, treemap_v2) confirmed to read only `columns` (not `groupby`) in their buildQuery.ts, so the rename is a pure key rename with no behavior change.
…rt unsafe types
Self-review caught that echarts_timeseries_line, echarts_area, and treemap_v2
buildQuery.ts implementations destructure `const { groupby } = formData` directly
(e.g. Timeseries/buildQuery.ts:44, Treemap/buildQuery.ts:27) rather than reading
`formData.columns`. A prior grep for `.groupby`/`formData.groupby` missed this
destructuring pattern. Renaming groupby->columns in those 10 files would silently
drop the grouping dimension from the query (Timeseries) or the orderby (Treemap) -
a real data/display regression, not a no-op.
Reverts the 10 affected files (Line, Area, Proportion_of_Revenue_by_Product_Line,
Messages_per_Channel, Commute_Time, Preferred_Employment_Style, TreeMap,
Members_per_Channel, Games_per_Genre, of_Games_That_Hit_100k_in_Sales_By_Release_Year)
back to their original groupby: key. The remaining 16 files (table, pie) are
confirmed safe: `table`'s buildQuery.ts only reads `baseQueryObject.columns`, and
`pie`'s buildQuery.ts never destructures `groupby` at all, relying on the generic
`extractQueryFields` groupby/columns aliasing.
Code Review Agent Run #fe3eccActionable Suggestions - 0Additional Suggestions - 2
Filtered by Review RulesBito filtered these suggestions based on rules created automatically for your feedback. Manage rules.
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 |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@kgabryje — routing this to you as our frontend-plugins reviewer. It renames the deprecated The whole safety argument lives in frontend query construction: the author's self-review already reverted |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #43723 +/- ##
===========================================
+ Coverage 64.16% 75.78% +11.62%
===========================================
Files 2591 2789 +198
Lines 138162 158053 +19891
Branches 32048 35175 +3127
===========================================
+ Hits 88647 119778 +31131
+ Misses 47986 35782 -12204
- Partials 1529 2493 +964
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:
|
Summary
Datadog logs for
apache/supersetproduction surface a recurringDeprecationWarning: "The fieldgroupbyis deprecated, please usecolumnsinstead." (superset/common/query_object.py::DEPRECATED_FIELDS).The
groupby->columnsrename was already applied to thebirth_names/world_bankexample fixtures in #43468 (still open). This closes the gap for a further batch of example dashboards:fcc_new_coder_survey,featured_charts,sales_dashboard,slack_dashboard,video_game_sales.Decisions made that were not in the instructions
None.
What changed
Renamed the top-level
groupby:key tocolumns:underparams:in 16 exported chart YAML fixtures, scoped strictly to two viz_types verified safe at the query-construction layer:table(8 files):plugin-chart-table'sbuildQuery.tsonly readsbaseQueryObject.columns(built via the genericextractQueryFieldsgroupby/columns aliasing), neverformData.groupbydirectly, for plain string columns like these fixtures use.pie(8 files):Pie/buildQuery.tsnever destructuresformData.groupbyat all; it relies entirely on the same genericextractQueryFieldsaliasing.Every changed file had exactly one top-level (
params:-level)groupby:key; unrelated same-named keys elsewhere in the same files (e.g. a per-columngroupby: true/false"is this groupable" flag nested inside a metric'scolumn:definition, and an inertqueryFields: {groupby: groupby}mapping block in one raw-mode table chart) were left untouched.Scope note: this PR was originally drafted covering 26 files across 5 viz_types (adding
echarts_timeseries_line,echarts_area,treemap_v2). Self-review caught that those three plugins'buildQuery.tsdestructuregroupbydirectly fromformData(e.g.Timeseries/buildQuery.ts:const { groupby } = formData, used to build bothcolumnsandseries_columns;Treemap/buildQuery.ts:groupbydrivesorderby) rather than reading the renamedcolumnsfield — renaming those would have silently dropped the grouping dimension / sort order from the affected example charts. Those 10 files were reverted before opening this PR; only the two types confirmed safe by direct code inspection are included here.No behavior change for the included files: this only renames a dict key that both
tableandpieconsume identically through the existingcolumns/groupbyalias inextractQueryFields.Test plan
yaml.safe_load()on all 16 changed files: clean.pre-commit run check-yaml / trailing-whitespace / end-of-file-fixeron all 16 files: clean.git diffthat only the single top-levelgroupby:key changed per file, with a per-file check confirming exactly one match for^ groupby:before editing.superset-frontend/plugins/**/buildQuery.tsfor bothformData.groupbyand destructuring (const { groupby } = formData) usage across all 5 originally-considered viz_types; confirmedtableandpienever readgroupby, whileecharts_timeseries_line/echarts_area(Timeseries/buildQuery.ts) andtreemap_v2(Treemap/buildQuery.ts) do, which is why those types were excluded from the final diff.