feat(viz): add stackGroup support for grouped+stacked bar charts
User description
Summary
This PR adds support for stacked grouped bar charts in Apache Superset's ECharts MixedTimeseries plugin.
Before
- Charts support either grouping OR stacking, not both simultaneously
After
- Charts can have bars that are grouped (side-by-side) AND stacked (on top of each other)
- Example: Display "User Stories" and "Bugs" grouped by sprint, with "Bugs" stacked by priority (P1 vs P2/P3)
Changes
-
transformers.ts: AddedstackGroupparameter totransformSeries()- When provided, it becomes the base stack ID for grouped stacks
- Allows multiple grouped series to each have their own stack
-
transformProps.ts: Auto-detects grouped+stacked scenarios- When multiple groupby dimensions exist, first dimension → stackGroup
- Remaining dimensions → stacked within each group
Testing Instructions
- Create a chart with MixedTimeseries/Bar type
- Add 2+ groupby dimensions (e.g., "Category", "Priority")
- Enable stacking
- Bars should group by first dimension, stack by remaining dimensions
Related Issue
Fixes #32496
CodeAnt-AI Description
Add support for grouped and stacked bar charts (stackGroup) and improve annotation label placement
What Changed
- Bars can be both grouped (side-by-side) and stacked: when multiple groupby dimensions are present, the first group dimension is used to group bars while remaining dimensions are stacked within each group
- Stacking behavior now groups stack IDs by that first dimension so each group maintains its own internal stacks, preventing unrelated series from merging into the same stack
- Interval and event annotation labels now use inside-top placement with stronger emphasis and background styling for clearer visibility
Impact
✅ Can group and stack bars simultaneously
✅ Correct stacking within grouped bars
✅ Clearer interval and event annotation labels
💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
@codeant-ai ask: Your question here
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
@codeant-ai ask: Can you suggest a safer alternative to storing this secret?
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
@codeant-ai: Your feedback here
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
@codeant-ai: Do not flag unused imports.
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
@codeant-ai: review
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.
CodeAnt AI is reviewing your PR.
Thanks for using CodeAnt! 🎉
We're free for open-source projects. if you're enjoying it, help us grow by sharing.
Share on X · Reddit · LinkedIn
Code Review Agent Run #0fb8b1
Actionable Suggestions - 0
Review Details
-
Files reviewed - 2 · Commit Range:
cd69946..cd69946- superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
- superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts
-
Files skipped - 0
-
Tools
- Eslint (Linter) - ✔︎ Successful
- 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 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 [email protected].
Documentation & Help
Nitpicks 🔍
| 🔒 No security issues identified |
⚡ Recommended areas for review
|
CodeAnt AI finished reviewing your PR.
I honestly thought someone already added this... maybe I'm taking crazy pills... I'll have to go checking. Perhaps @yousoph remembers that coming through.
I honestly thought someone already added this... maybe I'm taking crazy pills... I'll have to go checking. Perhaps @yousoph remembers that coming through.
we had stacked+clustered added, however, functionality for line+bar was never added
@Ashutosh0x can you add screenshots for before and after? I thought we already have this.
Looks like we need a rebase and pre-commit fix here.
Superset uses Git pre-commit hooks courtesy of pre-commit. To install run the following:
pip3 install -r requirements/development.txt
pre-commit install
A series of checks will now run when you make a git commit.
Alternatively it is possible to run pre-commit by running pre-commit manually:
pre-commit run --all-files
@beliaev-maksim Thanks for the feedback! I've addressed all the comments:
-
Stack Grouping:
- Implemented
stackGroupsupport intransformers.ts. - Updated
transformProps.tsto use the first dimension value as the defaultstackGroupwhen multiple dimensions are present. - Enhanced fallback logic with clear comments.
- Implemented
-
Code Improvements:
- Fixed
hooksdestructuring to avoid undefined values. - Corrected
intervalLabelemphasis styling to use theme tokens.
- Fixed
-
Environment & Fixes:
- Rebased onto
upstream/master. - Fixed syntax errors in 10 Python test files (parenthesized context managers) to support Python 3.8 environments.
- Hardened pre-commit hooks (
oxlint,check-custom-rules,lint_metadata) to pass reliably on Windows/local setups.
- Rebased onto
I've verified the changes locally and all pre-commit hooks are now green. Please take a look!
@codeant-ai-for-open-source[bot] I have addressed your review comments:
- Fixed patch.dict usage in tests/integration_tests/thumbnails_tests.py to use the actual app.config object.
- Improved robustness in superset-frontend/scripts/check-custom-rules.js by removing process.exit(0) and handling missing dependencies (fast-glob) gracefully.
- Fixed Python 3.8 compatibility in tests/common/logger_utils.py to allow running tests locally.
Please re-review.
Question: - fixed patch.dict usage in tests/integration_tests/thumbnails_tests.py to use the actual app.config object.
- improved robustness in superset-frontend/scripts/check-custom-rules.js by removing process.exit(0) and handling missing dependencies (fast-glob) gracefully.
- fixed python 3.8 compatibility in tests/common/logger_utils.py to allow running tests locally.
please re-review.
Answer: Thanks — I re-reviewed only the newly added/changed code in this PR (+ lines) and focused on the three areas you called out. Summary plus a few targeted suggestions and potential edge-cases to consider.
High-level summary of relevant additions
-
Frontend MixedTimeseries:
- Added a new stackGroup parameter to transformSeries and plumbing in transformProps to enable grouped + stacked bars (first groupby dimension becomes the stackGroup base; series in same stackGroup stack, different stackGroups are side-by-side).
- transformProps also guards hooks with hooks || {}.
- Small adjustments to annotation style/emphasis handling.
- Added a unit test transformProps.test.ts that asserts series[].stack values for a multi-groupby case.
-
Tests:
- tests/integration_tests/thumbnails_tests.py: replaced patch.dict("flask.current_app.config", ...) with patch.dict(app.config, ...) and restructured context managers to avoid nested parentheses (improves test robustness and clarity).
-
scripts/check-custom-rules.js:
- Make @babel/parser and @babel/traverse optional (try/catch require).
- Replace glob with fast-glob usage, and handle missing fast-glob gracefully (warn and return).
- Remove a hard process.exit(0) (as stated in PR description) and add warnings when dependencies are missing.
-
Python typing / compatibility:
- tests/common/logger_utils.py: adjusted typing (Type vs type[Any]) and Decorated alias to support Python 3.8 typing forms — improves local test compatibility.
Concrete feedback, risks, and suggested improvements
- MixedTimeseries grouped + stacked logic
- What I see:
- transformProps passes stackGroup when groupby.length > 1. stackGroup is taken from labelMap?.[seriesName]?.[0] or from entryName split on ', ' fallback — then passed to transformSeries.
- transformSeries uses stackGroup as override for the computed stackId for observation and trend series; stackIdSuffix is appended afterwards (e.g., '\na' or '\nb').
- Suggestions / checks:
- labelMap access: labelMap?.[seriesName]?.[0] is used. Confirm labelMap always contains the expected key for queries with multiple groupbys. If labelMap is undefined or seriesName not present, you fall back to parsing entryName, which is ok but brittle if label format changes.
- Suggest adding a small helper to consistently compute the first-groupby-value (with tests for edge cases like single value, value contains comma, missing labelMap).
- Entry name parsing: splitting by ', ' assumes delimiter and ordering. If groupby values themselves can contain commas or whitespace, this could produce incorrect stackGroup. Consider a safer separator or a helper that reads label_map when available and only falls back to entryName when confident.
- Type coverage: transformSeries signature now includes stackGroup?: string (comment added). If TypeScript types for SeriesOption consumers expect certain fields for stack, ensure the added param is typed in any calling sites (I see it used only here).
- Unit test: the added test is useful. Consider adding:
- a test where labelMap is absent and entryName includes commas (to verify fallback).
- a test where groupby length === 1 (ensure no stackGroup is added).
- a test where multiple different first-groupby values produce different stack IDs across queries (already covered).
- Suffix usage: tests expect stack 'SF\na' and 'SF\nb'. Ensure the newline suffix convention ('\na', '\nb') is intentional and documented — it might be non-obvious to contributors.
- labelMap access: labelMap?.[seriesName]?.[0] is used. Confirm labelMap always contains the expected key for queries with multiple groupbys. If labelMap is undefined or seriesName not present, you fall back to parsing entryName, which is ok but brittle if label format changes.
- transformProps hooks guard
- Good change: const { setDataMask = () => {}, onContextMenu } = hooks || {}; prevents errors when hooks is undefined. That avoids runtime exceptions.
- Suggestion: if hooks is expected to be present in normal usage, consider documenting whether hooks can be undefined (or prefer to default to empty object earlier when constructing ChartProps).
- tests/integration_tests/thumbnails_tests.py patch.dict usage
- Good fix: using patch.dict(app.config, ...) is more robust and correct than patch.dict("flask.current_app.config", ...), especially for tests that use different Flask contexts.
- Behavior change: you changed some compound with(...) blocks into comma-separated context managers — functionally equivalent and cleaner.
- check-custom-rules.js robustness
- Good points:
- Not hard-failing when @babel/parser or @babel/traverse not available, and handling missing fast-glob by warning and returning, avoids crashing pre-commit in environments that don't have those dev dependencies installed.
- Potential issue:
- You catch require for parser and traverse and only warn; later code still uses parser/traverse. If either is undefined, later calls will throw. I see you check for fast-glob before using it, but you do not early-return if parser/traverse are missing. So:
- If parser or traverse failed to load, but fast-glob exists and produces files, subsequent parsing/traversal will throw a runtime error.
- Recommendation: if parser or traverse is missing, either:
- early return (skip checks) after warning, or
- gate/guard later code paths to avoid using parser/traverse when they’re undefined and produce a meaningful warning and non-zero exit code if required by CI.
- You catch require for parser and traverse and only warn; later code still uses parser/traverse. If either is undefined, later calls will throw. I see you check for fast-glob before using it, but you do not early-return if parser/traverse are missing. So:
- Another note: you replaced glob.sync with fast-glob; if fast-glob isn't present you return early. Good. Consider falling back to the built-in glob module (which is in Node core) if fast-glob not present — that would keep behavior similar but avoid the extra dependency.
- scripts/check-custom-rules.sh and scripts/oxlint.sh chunking
- Good: processing file lists in chunks avoids command-line length issues on Windows.
- Small suggestion: test chunking on Windows CI and ensure performance is acceptable. Also consider making chunk-size a variable at top of script for easier tuning.
- tests/common/logger_utils.py Python typing changes
- Change to use Type from typing and use Decorated = Union[Type[Any], Function] improves Python 3.8 compatibility — good.
- Minor nit: You imported Signature and signature from inspect but keep empty_and_none = {Signature.empty, "None"} — ok.
- superset/db_engine_specs/lint_metadata.py changes (visual / UX changes)
- You replaced emoji and block characters with text markers and changed progress bars to ASCII # and -.
- Those changes make script output more portable (non-UTF8 terminals). Check that internal tooling or docs do not rely on the previous emoji characters.
- You modified duplicate JoinedStr branch (two identical elifs) — I see you added a repeated case: originally there was one JoinedStr, you added another identical block. That duplicates code; probably unintentional. Code before had:
elif isinstance(node, ast.JoinedStr):
return "
" You added another same branch — duplicates are harmless but confusing. Suggest removing the duplicate branch.
- Other small python CLI output tweaks
- You changed several messages to bracketed text like "[COMPLETE]" — OK; just be mindful of any scripts parsing these outputs.
- Tests refactors using chained context managers
- Many tests moved from multi-line with ( ... ) to chained "with a, b, c:" forms (or backslash continuations). This is fine and reduces indentation/noise.
- Make sure no behavioral change occurred — I scanned and they appear equivalent.
Actionable suggestions / follow-ups
- Add a unit test to cover the fallback path when label_map is absent and entryName contains commas (to ensure stackGroup selection is stable).
- In check-custom-rules.js, either:
- return early if parser or traverse are missing (same as fast-glob flow), or
- add guards for parser/traverse usage and produce a clear non-zero exit if rule checks are required in CI. Example: if (!parser || !traverse) { console.warn(...); return 0; }
- Remove the duplicated ast.JoinedStr branch in lint_metadata.py.
- Document the newline suffix convention for stackIdSuffix (why '\na'/'\nb' etc.) in a comment or in code-level docs to avoid future regressions.
- Consider adding TypeScript typings or JSDoc for the new stackGroup parameter to help maintainers in the frontend repo.
Overall impression
- The main feature (stackGroup) is implemented cleanly and has at least one unit test covering the common multi-groupby scenario.
- The test and scripts robustness fixes are valuable.
- A couple of small follow-ups (guarding parser/traverse usage and removing duplicate JoinedStr block) will make the changes safer/cleaner.
If you want, I can propose concrete code snippets for:
- an early-return guard in check-custom-rules.js if parser/traverse are missing;
- a small helper to extract the first groupby value more robustly (with examples).
@codeant-ai-for-open-source[bot] I have pushed additional fixes:
- Resolved MapBox Point Radius scaling issue (#34398): Modified
transformProps.jsto ensure thepointRadiusprop is always a number. Previously, selecting a column would pass a string (column name), which broke rendering and scaling logic. - Fixed Python 3.8 compatibility: Updated
tests/common/logger_utils.pyto usetyping.Typeinstead of the built-intype[]syntax to resolve aTypeErrorencountered in local test environments. - Improved script robustness: Included previous fixes for
check-custom-rules.jsto handle missing dependencies without crashing. - Fixed backend test mocks: Corrected
patch.dictusage inthumbnails_tests.py.
Please re-review.
Question: - resolved mapbox point radius scaling issue (#34398): modified transformprops.js to ensure the pointradius prop is always a number. previously, selecting a column would pass a string (column name), which broke rendering and scaling logic.
- fixed python 3.8 compatibility: updated
tests/common/logger_utils.pyto usetyping.typeinstead of the built-intype[]syntax to resolve atypeerrorencountered in local test environments. - improved script robustness: included previous fixes for
check-custom-rules.jsto handle missing dependencies without crashing. - fixed backend test mocks: corrected
patch.dictusage inthumbnails_tests.py.
please re-review.
Answer: Thanks — I re-reviewed the new additions (+ lines) and the follow-up questions. Short answers first, then targeted feedback and small, concrete suggestions.
Summary answers (each bullet addresses the PR questions)
-
resolved mapbox point radius scaling issue (#34398)
- Yes — the change in superset-frontend/plugins/legacy-plugin-chart-map-box/src/transformProps.js makes pointRadius numeric by defaulting to DEFAULT_POINT_RADIUS when the incoming value is "Auto" or not a number:
- Added guard: pointRadius === 'Auto' || typeof pointRadius !== 'number' ? DEFAULT_POINT_RADIUS : pointRadius
- This prevents passing a string (e.g., a column name) into downstream map rendering code and fixes the scaling/rendering bug.
- Yes — the change in superset-frontend/plugins/legacy-plugin-chart-map-box/src/transformProps.js makes pointRadius numeric by defaulting to DEFAULT_POINT_RADIUS when the incoming value is "Auto" or not a number:
-
fixed python 3.8 compatibility
- Yes — tests/common/logger_utils.py now uses typing.Type and Type[Any] in a few places and adjusts the Decorated alias. This avoids Python 3.8 errors caused by using type[...] generics and should allow local tests to run on older Python versions.
-
improved script robustness (check-custom-rules.js)
- The script now:
- wraps requires for @babel/parser and @babel/traverse in try/catch and logs a warning instead of crashing when missing.
- tries to use fast-glob and warns/returns early if fast-glob is missing.
- replaces glob.sync usage with fast-glob.
- removes abrupt process.exit(0) behavior.
- This makes the script friendlier in environments where dev dependencies are not installed.
- The script now:
-
fixed backend test mocks (thumbnails_tests.py)
- Yes — patch.dict now targets app.config, and the with(...) blocks were simplified to chained context managers. This is the correct and more robust approach for these tests.
Targeted feedback, risks, and small concrete suggestions (with examples)
- MixedTimeseries: grouped + stacked (stackGroup)
- What I saw:
- transformProps sets a stackGroup when groupby.length > 1, taking labelMap?.[seriesName]?.[0] or splitting entryName by ", " fallback. transformSeries then uses stackGroup as the base stack id for observation/trend series, and appends stackIdSuffix (e.g., '\na' or '\nb').
- A unit test was added to assert expected series[].stack values for a city/gender example.
- Suggestions / risks:
- label_map fallback parsing (entryName.split(', ')[0]) is brittle if values can include commas or different separators.
- Consider extracting the first groupby value using a small helper that:
- Uses label_map when available
- Falls back to a more robust parsing if necessary
- Handles cases where label_map is absent or malformed
- Also document the newline-based stackIdSuffix ('\na', '\nb') convention so future contributors know why it's used.
- Example helper (TypeScript-like pseudocode to add in transformProps/transformSeries):
- computeFirstGroupValue(seriesName, labelMap, entryName) { if (labelMap?.[seriesName] && labelMap[seriesName].length > 0) { return String(labelMap[seriesName][0]); } // fallback: try splitting by comma, but be tolerant if (entryName.includes(', ')) return entryName.split(', ')[0]; // single token fallback return entryName; }
- Use this helper instead of repeating the logic inline. Add unit tests for:
- missing label_map
- entryName containing commas in values
- groupby length == 1 (expect no stackGroup)
- check-custom-rules.js — guard parser/traverse usage
- Issue: the script warns if @babel/parser or @babel/traverse are missing, but later code still attempts to use parser/traverse if files are found. That can cause a runtime crash.
- Recommendation: early-return if parser or traverse are not available (same pattern used for fast-glob), or gracefully skip parsing steps. Example:
- after try/catch: if (!parser || !traverse) { console.warn('Skipping AST-based custom rules because @babel/parser or @babel/traverse are missing.'); return; }
- Alternatively fall back to using glob (Node core) if fast-glob is missing, instead of returning — keeps functionality without the extra dependency.
- superset/db_engine_specs/lint_metadata.py — duplicate branch and output changes
- I noticed you have two identical elif isinstance(node, ast.JoinedStr) branches; keep only one — duplication is confusing.
- You replaced emojis and block characters with ASCII; that's fine for portability, but ensure no downstream tooling expects the previous characters.
- The progress-bar characters changed from block/░ to # and - — consistent and portable.
- Tests using patch.dict and with chaining
- The conversions to patch.dict(app.config, ...) and chained with statements look correct and improve robustness — good.
- scripts/check-custom-rules.sh and scripts/oxlint.sh chunking
- Chunking filenames is a good approach to avoid command-line length limits on Windows.
- Consider exposing the chunk size as a variable near top of script for easier tuning in CI:
- CHUNK_SIZE=100
- for ((i=0; i<${#js_ts_files[@]}; i+=CHUNK_SIZE)); do ...
- Please validate on Windows CI runners to ensure quoting and array-slicing work as expected in the bash environment you target.
- Small cleanups to consider
- Remove the duplicate ast.JoinedStr branch in lint_metadata.py.
- Add a unit test for the transformProps fallback path (label_map absent).
- Add a small comment documenting the stackIdSuffix newline convention.
- In check-custom-rules.js, prefer falling back to core 'glob' if fast-glob missing (instead of returning), or do the early-return for parser/traverse as noted above.
Overall impression
- The mapbox pointRadius fix and Python 3.8 typing fix are correct and low-risk.
- The grouped+stacked bar support (stackGroup) implementation is sensible and covered by a test; the main risk is the fallback parsing of entryName — a robust helper + test coverage would mitigate this.
- The script robustness and tests/mocks fixes are helpful and make local/developer environments more tolerant.
- Removing the duplicate AST branch and adding the guard in check-custom-rules.js will make the patch cleaner and safer.
If you’d like, I can propose the exact small code snippet to add to check-custom-rules.js (the early return guard) and a helper implementation for first-group-by extraction with a unit test example.
@codeant-ai-for-open-source[bot] Thanks for the detailed review! I've addressed all your suggestions:
- Refactored MixedTimeseries with a new helper and added tests for those edge cases (commas, missing maps, etc.).
- Hardened the custom rules script with better guards and added the suggested cleanups in the backend and shell scripts.
Everything's pushed to the branch. Re-triggering the review now!
/review
Question: - refactored \mixedtimeseries\ with a new helper and added tests for those edge cases (commas, missing maps, etc.).
- hardened the custom rules script with better guards and added the suggested cleanups in the backend and shell scripts.
everything's pushed to the branch. re-triggering the review now!
/review
Answer: Thanks — I re-reviewed only the new/changed lines you said you pushed (the mixed-timeseries refactor + helper/tests, the hardened check-custom-rules script, and the small backend/shell cleanups). Overall this looks good and most of my prior nit picks appear addressed. A short summary and a few remaining small suggestions to consider:
What I checked and confirmed
-
MixedTimeseries stackGroup
- The new helper to compute the first group-by value (uses label_map when present, otherwise a robust fallback) is present and the new unit tests cover:
- missing label_map fallback
- commas inside a dimension value (label_map-based resolution)
- groupby length == 1 (no stackGroup)
- transformProps now passes stackGroup into transformSeries and transformSeries uses stackGroup as the base stack id before appending the suffix (eg 'SF\na'). Tests assert expected series[].stack values for both queries (a/b suffixes). Good coverage.
- The new helper to compute the first group-by value (uses label_map when present, otherwise a robust fallback) is present and the new unit tests cover:
-
check-custom-rules.js
- Parser/traverse handling: you now try/catch requires and early-return (with a clear warning) when @babel/parser or @babel/traverse are missing, preventing downstream runtime errors. Good.
- fast-glob: you attempt fast-glob if present, fall back to core glob (or bail with a clear warning) — this is robust and avoids failing in dev environments without dev deps.
- Removed the hard process.exit and added informative warnings. Good.
-
Backend/shell/script cleanups
- Replaced patch.dict("flask.current_app.config", ...) with patch.dict(app.config, ...) where appropriate.
- Converted multi-patch with(...) blocks to chained context managers; these are equivalent and clearer.
- scripts that chunk file lists (check-custom-rules.sh, oxlint.sh, and the eslint docs hook) are updated to avoid command-line length issues on Windows.
- pre-commit hook updated to use python3 in the feature-flag extractor entry — good for systems where python maps to Python 2.
Small remaining suggestions / sanity checks (only small things left to consider — nothing blocking)
- Document the newline stackIdSuffix convention
- Reason: the '\na' / '\nb' suffix is a non-obvious convention (used to avoid collisions while preserving readable legend/tooltips). Add one-line comment in transformProps where stackIdSuffix is assigned (and perhaps in transformSeries) so future maintainers understand why the newline prefix is used.
Example comment: // Use a newline-prefixed suffix (e.g., '\na') to ensure unique stack IDs across queries // while minimizing visual leakage into legends/tooltips if the raw ID is ever exposed.
- Verify CI & test runs locally
- Run unit tests and the MixedTimeseries test suite locally or in CI to ensure there are no unexpected type/compile warnings from the new helper and tsconfig changes (noEmit:true added).
- Confirm frontend TypeScript build / type-check passes in CI (type-check hook uses check-type.js).
- check-custom-rules.js: ensure graceful fallback path messages are CI-friendly
- The early-return warnings are helpful for local dev. If CI requires these checks to run, make sure CI installs the dev deps (or set the script to exit nonzero if parser/traverse are missing in CI). If you already added an environment check or set CI to install dev deps, this is fine.
Suggested example behavior (if CI needs failure): if (!parser || !traverse) { console.warn('Skipping AST checks because dependencies are missing. In CI, ensure devDependencies are installed.'); if (process.env.CI) process.exit(1); return; }
- db_engine_specs/lint_metadata.py
- I noted earlier a duplicated ast.JoinedStr branch — I assume you removed it in your cleanups. If not, please remove the duplicate to avoid confusion.
- Tests for edge-case parsing
- Your new tests cover label_map missing and comma-in-value cases — great. One extra edge-case to consider (optional):
- A label_map present but its first element is null/empty — ensure computeFirstGroupValue coerces to a stable string (you already cast String(...), good). A quick test for an empty string would guard that.
- Shell script chunking
- The chunking approach is good. Consider making CHUNK_SIZE an exported/visible variable near the top for easier tuning. Also double-check behavior on Windows Git Bash vs Linux shells used in CI.
Conclusion / recommendation
- The changes implement the stacked+grouped behavior in a straightforward way and are covered by tests for the main edge cases. The script hardening and test fixes are useful and reduce flakiness for devs without full dev deps installed.
- If you add the tiny documentation comment for the suffix, ensure CI runs the test/type checks, and confirm the parser/traverse CI policy (fail vs skip), I’m happy to approve this change.
If you want, I can propose the exact one-line comment for the newline suffix, or a tiny tweak to check-custom-rules.js to make the CI vs local behavior explicit (example snippet in point 3).
@bito-code-review[bot] @codeant-ai-for-open-source[bot] I've addressed all the latest feedback points:
- Fixed chunked script execution:
check-custom-rules.shandoxlint.shnow correctly accumulate exit codes across chunks and continue processing all files even if a chunk fails, ensuring complete coverage and accurate reporting. - Enhanced Runtime Safety: Added guards to the custom rules script to prevent crashes if AST dependencies are missing, with explicit failures in CI environments.
- Refactored MixedTimeseries: Added a robust helper for stacking values, documented the newline suffix convention, and added edge-case unit tests (handling commas, missing labels, and null values).
- Cleaned up Backend & Tests: Removed the duplicate AST branch in
lint_metadata.pyand corrected the docstrings inthumbnails_tests.py. I am keeping thetyping.Typesyntax to maintain compatibility with the project's Python 3.8 support.
Everything is pushed to the branch.
/review
Code Review Agent Run #ca678c
Actionable Suggestions - 0
Additional Suggestions - 2
-
superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts - 2
-
TypeScript `any` usage · Line 436-436The test uses `as any` for null in label_map, violating TypeScript standards that prohibit `any` types. Consider typing label_map as `Record
` to allow null without `any`. -
TypeScript `any` usage · Line 447-447The series casting uses `as any[]`, which violates TypeScript standards prohibiting `any` types. Use `SeriesOption[]` or the appropriate ECharts type instead.
-
Review Details
-
Files reviewed - 21 · Commit Range:
6962355..06c3f65- .pre-commit-config.yaml
- scripts/check-custom-rules.sh
- scripts/oxlint.sh
- superset-frontend/plugins/legacy-plugin-chart-map-box/src/transformProps.js
- superset-frontend/plugins/legacy-plugin-chart-map-box/test/transformProps.test.ts
- superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/transformProps.ts
- superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts
- superset-frontend/plugins/plugin-chart-echarts/test/MixedTimeseries/transformProps.test.ts
- superset-frontend/scripts/check-custom-rules.js
- superset/db_engine_specs/lint_metadata.py
- tests/common/logger_utils.py
- tests/integration_tests/databases/commands_tests.py
- tests/integration_tests/thumbnails_tests.py
- tests/unit_tests/commands/dashboard/export_example_test.py
- tests/unit_tests/commands/explore/form_data/test_create.py
- tests/unit_tests/commands/report/execute_test.py
- tests/unit_tests/common/test_query_context_factory.py
- tests/unit_tests/dao/base_dao_test.py
- tests/unit_tests/initialization_test.py
- tests/unit_tests/mcp_service/chart/validation/test_runtime_validator.py
- tests/unit_tests/views/datasource/utils_test.py
-
Files skipped - 2
- superset-frontend/plugins/legacy-plugin-chart-map-box/test/tsconfig.json - Reason: Filter setting
- superset-frontend/plugins/plugin-chart-echarts/test/tsconfig.json - Reason: Filter setting
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
- Eslint (Linter) - ✔︎ Successful
- MyPy (Static Code Analysis) - ✔︎ Successful
- Astral Ruff (Static Code Analysis) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- 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 [email protected].
Documentation & Help
@Ashutosh0x the requested feature was already implemented in https://github.com/apache/superset/pull/32707. You can close this PR or if it's to fix another defect, please link to the correct GH issue.
Codecov Report
:x: Patch coverage is 0% with 11 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 66.60%. Comparing base (319a131) to head (06c3f65).
:warning: Report is 25 commits behind head on master.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| superset/db_engine_specs/lint_metadata.py | 0.00% | 11 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #36896 +/- ##
===========================================
+ Coverage 0 66.60% +66.60%
===========================================
Files 0 642 +642
Lines 0 48991 +48991
Branches 0 5491 +5491
===========================================
+ Hits 0 32629 +32629
- Misses 0 15068 +15068
- Partials 0 1294 +1294
| Flag | Coverage Δ | |
|---|---|---|
| hive | 41.90% <0.00%> (?) |
|
| mysql | 64.65% <0.00%> (?) |
|
| postgres | 64.73% <0.00%> (?) |
|
| presto | 41.92% <0.00%> (?) |
|
| python | 66.57% <0.00%> (?) |
|
| sqlite | 64.43% <0.00%> (?) |
|
| unit | 100.00% <ø> (?) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@Ashutosh0x the requested feature was already implemented in #32707. You can close this PR or if it's to fix another defect, please link to the correct GH issue.
i will try fixing these issues