fix(echarts): rename time series shifted without dimensions#34541
Conversation
There was a problem hiding this comment.
I've completed my review and didn't find any issues.
Files scanned
| File Path | Reviewed |
|---|---|
| superset-frontend/packages/superset-ui-chart-controls/src/operators/renameOperator.ts | ✅ |
Explore our documentation to understand the languages and file types we support and the files we ignore.
Check out our docs on how you can make Korbit work best for you and your team.
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the rename operator logic to handle time series charts with multiple time shifts but no dimensions. Previously, the operator only applied when dimensions existed, but the fix now also applies when multiple time shift metrics are present, improving chart readability by properly renaming metric columns.
- Updates the condition to include cases with multiple time shifts even without dimensions
- Adds comprehensive test coverage for both single and multiple time shift scenarios
- Improves chart labeling for time comparison visualizations without dimensional grouping
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
superset-frontend/packages/superset-ui-chart-controls/src/operators/renameOperator.ts |
Updates the core logic to apply rename operation when multiple time shifts exist, even without dimensions |
superset-frontend/packages/superset-ui-chart-controls/test/operators/renameOperator.test.ts |
Adds test cases for single and multiple time shift scenarios to verify the updated behavior |
Comments suppressed due to low confidence (2)
superset-frontend/packages/superset-ui-chart-controls/test/operators/renameOperator.test.ts:68
- [nitpick] The test name is unclear. Consider renaming to 'should skip renameOperator when no dimensions exist and only single time shift' to better describe the specific condition being tested.
test('should skip renameOperator if series does not exist and a single time shift exists', () => {
superset-frontend/packages/superset-ui-chart-controls/test/operators/renameOperator.test.ts:110
- [nitpick] The test name has grammatical issues. Consider renaming to 'should add renameOperator when metric exists with multiple time shifts' for better clarity and grammatical correctness.
test('should add renameOperator if a metric exists and multiple time shift', () => {
(cherry picked from commit 6f5d9c9)
SUMMARY
This commit updates the rename operator logic to handle cases that contain only metrics without dimensions but contain multiple time shifts.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before (single metric):
After (single metric):
Before (multiple metrics):
After (multiple metrics):
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION