Skip to content

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

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

eschutho wants to merge 5 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 057d872
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6ab6ff8b3abadf0007e0a38c
😎 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
@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 81.11%. Comparing base (10ca640) to head (057d872).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #43723   +/-   ##
=======================================
  Coverage   81.11%   81.11%           
=======================================
  Files        2955     2955           
  Lines      178335   178335           
  Branches    41311    41311           
=======================================
+ Hits       144660   144663    +3     
+ Misses      30972    30969    -3     
  Partials     2703     2703           
Flag Coverage Δ
hive 36.82% <ø> (ø)
mysql 56.03% <ø> (-0.01%) ⬇️
postgres 56.03% <ø> (ø)
presto 38.72% <ø> (ø)
python 85.39% <ø> (-0.01%) ⬇️
sqlite 55.75% <ø> (ø)
unit 77.68% <ø> (-0.01%) ⬇️

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.

@eschutho

eschutho commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

Pulling this back for re-review pending a fix.

An independent review (EngCodeReviewBot / Minerva) that cleared superset/examples/usa_births_names/charts/Genders.yaml (Pie chart) as safe on 2026-08-31 has since retracted that sign-off. That review had only grepped buildQuery.ts; the actual consumer of the groupby formData key for Pie charts is plugin-chart-echarts/src/Pie/controlPanel.tsx, whose Query section reads groupby directly. On the frontend, superset-frontend/src/query/extractQueryFields.ts discards a columns key in aggregate mode and only reads the grouping dimension from groupby — so renaming groupby → columns here likely drops the grouping dimension from the Genders (Pie) chart, the same bug class found in the sibling PR #43468.

Converting to draft until this is re-verified. cc @kamil for re-review once resolved.

… charts

EngCodeReviewBot's 2026-09-03 review (posted on this PR) retracted its
earlier pie-chart sign-off: plugin-chart-echarts/src/Pie/controlPanel.tsx
names its dimension control literally 'groupby' (confirmed at
controlPanel.tsx:54), and extractQueryFields.ts discards a 'columns' key
in aggregate mode (extractQueryFields.ts:74-78) rather than aliasing it
back to groupby. So a pie-type fixture with columns: instead of groupby:
silently drops its grouping dimension - the identical bug class already
found in the 10 echarts_timeseries_line/echarts_area/treemap_v2 files
reverted by the prior commit on this branch.

Reverts the rename on the 8 remaining pie-type files (all other viz_types
in this PR are table, confirmed safe: buildQuery.ts only reads
baseQueryObject.columns). No table-type files touched.

Co-Authored-By: Claude <noreply@anthropic.com>
@pull-request-size pull-request-size Bot added size/S and removed size/M labels Sep 9, 2026
@bito-code-review

bito-code-review Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #40c5aa

Actionable Suggestions - 0
Review Details
  • Files reviewed - 8 · Commit Range: a38285a..7068175
    • superset/examples/fcc_new_coder_survey/charts/Are_you_an_ethnic_minority_in_your_city.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/Relocation_ability.yaml
    • superset/examples/fcc_new_coder_survey/charts/Work_Location_Preference.yaml
    • superset/examples/featured_charts/charts/Pie.yaml
    • superset/examples/sales_dashboard/charts/Overall_Sales_By_Product_Line.yaml
    • superset/examples/video_game_sales/charts/Most_Dominant_Platforms.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

@eschutho
eschutho requested review from aminghadersohi and removed request for kgabryje September 16, 2026 20:01
@eschutho

Copy link
Copy Markdown
Member Author

Re-routing review on this one. @kgabryje was the sole requested reviewer since 2026-08-31 but hasn't had a chance to get to it in the 16+ days since (no worries — everyone's stretched). Since the risk surface here is frontend chart-rendering correctness for the pie/table example charts, I've requested @aminghadersohi, who reviewed and approved the two nearest siblings in this same deprecation series (#43422, #43432) and is active on frontend/viz PRs. Thanks both.

@aminghadersohi

Copy link
Copy Markdown
Contributor

@eschutho — flagging CI before this sits in a reviewer's queue: the latest head (7068175) has 8 failing checks, including the required aggregates (unit-tests-required, playwright-tests-required, cypress-matrix-required).

The good news is that none of them look like your diff:

  • unit-tests (current) — 14970 passed, 5 skipped, 2 xfailed; the job failed in a later step, not the tests.
  • playwright-tests (chromium) — died with exit code 127 (command not found) before running tests.
  • cypress-matrix (chrome) — cypress_run.py: error: argument --parallelism: expected one argument.

Those are harness/workflow-level failures, and the run dates to 2026-09-09 against a now-stale branch. A rebase on current master plus a re-run should clear them.

Could you get it green before the review pass? Reviewers here don't pick up red-CI PRs, so this is the one thing standing between #43723 and a review. 🦉

— Minerva (EngCodeReviewBot)

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executed buildQueryObject on all 8 charts: the 3 raw-mode files are byte-identical, but all 5 aggregate-mode files lose their dimension, because extractQueryFields:76 discards a literal columns key before the groupby->columns rename at :89.

Comment thread superset/examples/fcc_new_coder_survey/charts/Breakdown_of_Developer_Type.yaml Outdated
Comment thread superset/examples/fcc_new_coder_survey/charts/Highest_degree_held.yaml Outdated
Comment thread superset/examples/sales_dashboard/charts/Total_Items_Sold_By_Product_Line.yaml Outdated
Comment thread superset/examples/slack_dashboard/charts/Top_Timezones.yaml Outdated
…regate-mode table charts

Per aminghadersohi's review, five more table charts in this PR run with
query_mode: aggregate and had their `groupby:` key renamed to a literal
`columns:` key. In extractQueryFields.ts, the aggregate-mode guard
(`if (queryMode === QueryMode.Aggregate && normalizedKey === 'columns')
return;`) runs before the groupby->columns alias is applied, so a literal
`columns:` key is silently dropped and the chart loses its grouping
dimension. Restore `groupby:` on:

- fcc_new_coder_survey/charts/Breakdown_of_Developer_Type.yaml
- fcc_new_coder_survey/charts/Highest_degree_held.yaml
- fcc_new_coder_survey/charts/Top_15_Languages_Spoken_at_Home.yaml
- sales_dashboard/charts/Total_Items_Sold_By_Product_Line.yaml
- slack_dashboard/charts/Top_Timezones.yaml

Raw-mode table charts (Table, Games, Publishers_With_Most_Titles) are
unaffected and keep the rename.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@aminghadersohi aminghadersohi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aggregate reverts verified — buildQueryObject output now matches the merge base on all 8 files. But the query_object.py:221 warning fires on query_context.queries[].groupby; these 3 charts are query_context: null + raw mode, so the rename can't silence it.

datasource: 21__table
granularity_sqla: year
groupby:
columns:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

columns is not a control in plugin-chart-table (controlPanel.tsx declares groupby + all_columns). groupby: [name] is the retained aggregate-mode Dimensions value (resetOnHide: false), so switching this chart to Aggregate now starts empty.

Suggested change
columns:
groupby:

@bito-code-review

bito-code-review Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Agent Run #6fc941

Actionable Suggestions - 0
Review Details
  • Files reviewed - 5 · Commit Range: 7068175..0b6345f
    • superset/examples/fcc_new_coder_survey/charts/Breakdown_of_Developer_Type.yaml
    • superset/examples/fcc_new_coder_survey/charts/Highest_degree_held.yaml
    • superset/examples/fcc_new_coder_survey/charts/Top_15_Languages_Spoken_at_Home.yaml
    • superset/examples/sales_dashboard/charts/Total_Items_Sold_By_Product_Line.yaml
    • superset/examples/slack_dashboard/charts/Top_Timezones.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

@rusackas

Copy link
Copy Markdown
Member

Thanks @eschutho, this is down to just the three raw-mode table charts now.

I agree with Amin's open thread on Games.yaml: columns isn't a control in the table plugin (it declares groupby and all_columns), so the retained groupby: [name] is the Dimensions value if someone flips the chart to Aggregate. Renaming it means that switch starts empty. Do we gain anything from touching these three at all, or should we leave the table fixtures alone and drop the PR? Curious what you think.

This branch has not been deployed

No deployments
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.

3 participants