Skip to content

Conversation

@amaannawab923
Copy link
Contributor

The Time Shift (time comparison) feature was already implemented in the AG Grid Table plugin but was gated behind the TableV2TimeComparisonEnabled feature flag. This commit enables the feature and adds dashboard override support to bring AG Grid Table to full parity with the normal Table plugin.

Changes:

  • Removed feature flag checks from controlPanel.tsx and transformProps.ts
  • Added extra_form_data.time_compare override logic in buildQuery.ts so dashboard-level time shifts can override chart-level settings
  • Added merge() for extra_form_data in transformProps.ts to properly propagate dashboard filter overrides to the chart

This allows users to:

  • Use Time Comparison controls in Aggregate mode (1 week ago, 1 month ago, etc.)
  • See expanded columns (Main, #, △, %) for each metric
  • Have dashboard filters override chart-level time shift settings

Related PRs: #33947, #34014

SUMMARY

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

The Time Shift (time comparison) feature was already implemented in the
AG Grid Table plugin but was gated behind the TableV2TimeComparisonEnabled
feature flag. This commit enables the feature and adds dashboard override
support to bring AG Grid Table to full parity with the normal Table plugin.

Changes:
- Removed feature flag checks from controlPanel.tsx and transformProps.ts
- Added extra_form_data.time_compare override logic in buildQuery.ts so
  dashboard-level time shifts can override chart-level settings
- Added merge() for extra_form_data in transformProps.ts to properly
  propagate dashboard filter overrides to the chart

This allows users to:
- Use Time Comparison controls in Aggregate mode (1 week ago, 1 month ago, etc.)
- See expanded columns (Main, #, △, %) for each metric
- Have dashboard filters override chart-level time shift settings

Related PRs: #33947, #34014
@amaannawab923 amaannawab923 marked this pull request as ready for review January 13, 2026 06:28
@netlify
Copy link

netlify bot commented Jan 13, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit d87b930
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/6965e5f41ab99900088817e0
😎 Deploy Preview https://deploy-preview-37072--superset-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@bito-code-review bito-code-review bot left a comment

Choose a reason for hiding this comment

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

Code Review Agent Run #727e7f

Actionable Suggestions - 1
  • superset-frontend/plugins/plugin-chart-ag-grid-table/src/buildQuery.ts - 1
Review Details
  • Files reviewed - 3 · Commit Range: d87b930..d87b930
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/buildQuery.ts
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Comment on lines 125 to 130
if (
extra_form_data?.time_compare &&
!timeOffsets.includes(extra_form_data.time_compare)
) {
timeOffsets = [extra_form_data.time_compare];
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Incorrect override logic

The added condition prevents overriding when the dashboard time_compare value is already present in the chart's timeOffsets array, but the comment indicates dashboard should OVERRIDE chart settings. This could lead to inconsistent behavior where dashboard filters don't take precedence if the value matches one in the chart's multiple shifts. If dashboard sets a single shift, it should always replace the chart's timeOffsets.

Code suggestion
Check the AI-generated fix before applying
Suggested change
if (
extra_form_data?.time_compare &&
!timeOffsets.includes(extra_form_data.time_compare)
) {
timeOffsets = [extra_form_data.time_compare];
}
if (extra_form_data?.time_compare) {
timeOffsets = [extra_form_data.time_compare];
}

Code Review Run #727e7f


Should Bito avoid suggestions like this for future reviews? (Manage Rules)

  • Yes, avoid them

@codeant-ai-for-open-source
Copy link
Contributor

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

@codeant-ai-for-open-source
Copy link
Contributor

CodeAnt AI finished reviewing your PR.

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 13, 2026

Code Review Agent Run #4d9883

Actionable Suggestions - 0
Review Details
  • Files reviewed - 4 · Commit Range: d87b930..4d06409
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/buildQuery.ts
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/controlPanel.tsx
    • superset-frontend/plugins/plugin-chart-ag-grid-table/src/transformProps.ts
    • superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/FiltersConfigModal.test.tsx
  • 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 evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

@amaannawab923 amaannawab923 merged commit 39238ef into master Jan 19, 2026
81 checks passed
@amaannawab923 amaannawab923 deleted the amaan/time_shift_ag_grid_migration branch January 19, 2026 09:26
JCelento pushed a commit to JCelento/superset that referenced this pull request Jan 19, 2026
JCelento pushed a commit to JCelento/superset that referenced this pull request Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants