Skip to content

fix(examples): replace deprecated groupby field with columns in example chart YAMLs - #43723

Open
eschutho wants to merge 2 commits into
apache:masterfrom
eschutho:fix/deprecated-groupby-field-example-charts
Open

fix(examples): replace deprecated groupby field with columns in example chart YAMLs#43723
eschutho wants to merge 2 commits into
apache:masterfrom
eschutho:fix/deprecated-groupby-field-example-charts

Conversation

@eschutho

Copy link
Copy Markdown
Member

Summary

Datadog logs for apache/superset production surface a recurring DeprecationWarning: "The field groupby is deprecated, please use columns instead." (superset/common/query_object.py::DEPRECATED_FIELDS).

The groupby -> columns rename was already applied to the birth_names/world_bank example 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 to columns: under params: 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's buildQuery.ts only reads baseQueryObject.columns (built via the generic extractQueryFields groupby/columns aliasing), never formData.groupby directly, for plain string columns like these fixtures use.
  • pie (8 files): Pie/buildQuery.ts never destructures formData.groupby at all; it relies entirely on the same generic extractQueryFields aliasing.

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-column groupby: true/false "is this groupable" flag nested inside a metric's column: definition, and an inert queryFields: {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.ts destructure groupby directly from formData (e.g. Timeseries/buildQuery.ts: const { groupby } = formData, used to build both columns and series_columns; Treemap/buildQuery.ts: groupby drives orderby) rather than reading the renamed columns field — 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 table and pie consume identically through the existing columns/groupby alias in extractQueryFields.

Test plan

  • yaml.safe_load() on all 16 changed files: clean.
  • pre-commit run check-yaml / trailing-whitespace / end-of-file-fixer on all 16 files: clean.
  • Verified via git diff that only the single top-level groupby: key changed per file, with a per-file check confirming exactly one match for ^ groupby: before editing.
  • Independently grepped superset-frontend/plugins/**/buildQuery.ts for both formData.groupby and destructuring (const { groupby } = formData) usage across all 5 originally-considered viz_types; confirmed table and pie never read groupby, while echarts_timeseries_line/echarts_area (Timeseries/buildQuery.ts) and treemap_v2 (Treemap/buildQuery.ts) do, which is why those types were excluded from the final diff.

…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.
@bito-code-review

bito-code-review Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #fe3ecc

Actionable Suggestions - 0
Additional Suggestions - 2
  • superset/examples/video_game_sales/charts/Most_Dominant_Platforms.yaml - 1
    • Pie groupby key breaks render · Line 38-38
      This is a Pie chart, and `transformProps.ts` (line 151) destructures `groupby` from formData, then calls `groupby.map(getColumnLabel)` (line 181). Renaming the YAML key to `columns:` leaves `formData.groupby` undefined, so rendering throws. `extractQueryFields` normalizes `groupby`→`columns` for the query, so the original key was safe. Revert to `groupby:`.
  • superset/examples/featured_charts/charts/Pie.yaml - 1
    • Pie groupby key mismatch · Line 36-36
      Renaming `groupby` to `columns` here breaks the Pie chart. `Pie/transformProps.ts` destructures `groupby` from formData and calls `groupby.map(getColumnLabel)`; with no `groupby` key, it falls back to the `DEFAULT_FORM_DATA` default `groupby: []`, so the pie renders without the `product_line` grouping. `extractQueryFields` only normalizes `columns`→`groupby` in the query object, not in the formData `transformProps` reads. Revert to `groupby:` or update `transformProps` to read `columns`.
Filtered by Review Rules

Bito filtered these suggestions based on rules created automatically for your feedback. Manage rules.

  • superset/examples/fcc_new_coder_survey/charts/Highest_degree_held.yaml - 1
  • superset/examples/sales_dashboard/charts/Total_Items_Sold_By_Product_Line.yaml - 1
  • superset/examples/fcc_new_coder_survey/charts/Top_15_Languages_Spoken_at_Home.yaml - 1
Review Details
  • Files reviewed - 16 · Commit Range: 99d02f5..a38285a
    • superset/examples/fcc_new_coder_survey/charts/Are_you_an_ethnic_minority_in_your_city.yaml
    • superset/examples/fcc_new_coder_survey/charts/Breakdown_of_Developer_Type.yaml
    • superset/examples/fcc_new_coder_survey/charts/First_Time_Developer.yaml
    • superset/examples/fcc_new_coder_survey/charts/Gender.yaml
    • superset/examples/fcc_new_coder_survey/charts/Highest_degree_held.yaml
    • superset/examples/fcc_new_coder_survey/charts/Relocation_ability.yaml
    • superset/examples/fcc_new_coder_survey/charts/Top_15_Languages_Spoken_at_Home.yaml
    • superset/examples/fcc_new_coder_survey/charts/Work_Location_Preference.yaml
    • superset/examples/featured_charts/charts/Pie.yaml
    • superset/examples/featured_charts/charts/Table.yaml
    • superset/examples/sales_dashboard/charts/Overall_Sales_By_Product_Line.yaml
    • superset/examples/sales_dashboard/charts/Total_Items_Sold_By_Product_Line.yaml
    • superset/examples/slack_dashboard/charts/Top_Timezones.yaml
    • superset/examples/video_game_sales/charts/Games.yaml
    • superset/examples/video_game_sales/charts/Most_Dominant_Platforms.yaml
    • superset/examples/video_game_sales/charts/Publishers_With_Most_Titles.yaml
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers an incremental AI Review.

  • /review full - Manually triggers a full AI Review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@netlify

netlify Bot commented Aug 31, 2026

Copy link
Copy Markdown

Deploy Preview for superset-docs-preview ready!

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

@eschutho
eschutho requested a review from kgabryje August 31, 2026 16:28
@eschutho

Copy link
Copy Markdown
Member Author

@kgabryje — routing this to you as our frontend-plugins reviewer. It renames the deprecated groupby: key to columns: in 16 example chart YAMLs, scoped to table (8) and pie (8) only.

The whole safety argument lives in frontend query construction: the author's self-review already reverted echarts_timeseries_line/echarts_area/treemap_v2 because those buildQuery.ts read formData.groupby directly (Timeseries feeds series_columns, Treemap drives orderby), whereas table/pie never touch it. The value-add here is a second pair of eyes confirming no included viz_type silently drops its grouping dimension. Thanks 🦉

@codecov

codecov Bot commented Aug 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.78%. Comparing base (8d2b655) to head (a38285a).
⚠️ Report is 2541 commits behind head on master.

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     
Flag Coverage Δ
hive 37.89% <ø> (-1.57%) ⬇️
mysql 57.57% <ø> (-1.58%) ⬇️
postgres 57.61% <ø> (-1.63%) ⬇️
presto 39.80% <ø> (-1.35%) ⬇️
python 83.74% <ø> (+23.07%) ⬆️
sqlite 57.30% <ø> (-1.58%) ⬇️
unit 74.00% <ø> (-26.00%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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