Skip to content

Conversation

@luizotavio32
Copy link
Contributor

@luizotavio32 luizotavio32 commented Jan 6, 2026

SUMMARY

Adds a "Last queried at" timestamp to charts, showing users when the underlying query was last executed. This provides visibility into data freshness, helping users understand whether they're viewing cached results and when the data was last fetched from the database.

Dashboard-level configuration: The timestamp visibility can be toggled on/off per dashboard via Dashboard Properties → Styling → "Show chart query timestamps". This setting is off by default and only affects charts in the dashboard view, chart explore view and Force Refresh tooltip will still be shown.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Dashboard View - Show chart query timestamps must be ON:
image

Chart Explore View:
image

Chart's Force Refresh tooltip:
ezgif-1c071fbfc05b5c1f

Setting up dashboard configuration:
ezgif-80cae71af5a4ea21

TESTING INSTRUCTIONS

  1. Open a chart in Explore view
  2. Run a query - verify "Last queried at: [timestamp]" appears in the bottom right of the chart
  3. Navigate to a dashboard with charts
  4. Verify timestamps are hidden by default (setting is off)
  5. Open Dashboard Properties → Styling section
  6. Toggle "Show chart query timestamps" to ON and save
  7. Verify each chart now displays the "Last queried at" timestamp after loading
  8. Refresh a chart and confirm the timestamp updates
  9. Toggle the setting back to OFF and save
  10. Verify timestamps are hidden on all dashboard charts
  11. Verify the setting persists after page reload
  12. Verify cached queries also display their original query timestamp when enabled

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

@luizotavio32 luizotavio32 force-pushed the chart-query-last-run-timestamp branch from e5f1654 to 2592b1c Compare January 6, 2026 23:36
@luizotavio32 luizotavio32 changed the title Chart query last run timestamp feat: Chart query last run timestamp Jan 6, 2026
@netlify
Copy link

netlify bot commented Jan 6, 2026

Deploy Preview for superset-docs-preview ready!

Name Link
🔨 Latest commit 2592b1c
🔍 Latest deploy log https://app.netlify.com/projects/superset-docs-preview/deploys/695d9c7d30a55900088daa19
😎 Deploy Preview https://deploy-preview-36934--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.

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.93%. Comparing base (9aff89c) to head (63d6c23).
⚠️ Report is 36 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #36934       +/-   ##
===========================================
+ Coverage        0   67.93%   +67.93%     
===========================================
  Files           0      642      +642     
  Lines           0    47898    +47898     
  Branches        0     5227     +5227     
===========================================
+ Hits            0    32538    +32538     
- Misses          0    14079    +14079     
- Partials        0     1281     +1281     
Flag Coverage Δ
hive 42.92% <50.00%> (?)
mysql 65.94% <100.00%> (?)
postgres 65.99% <100.00%> (?)
presto 46.50% <100.00%> (?)
python 67.90% <100.00%> (?)
sqlite 65.71% <100.00%> (?)
unit 100.00% <ø> (?)

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

☔ View full report in Codecov by Sentry.
📢 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.

@luizotavio32 luizotavio32 marked this pull request as ready for review January 6, 2026 23:55
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 #7e0279

Actionable Suggestions - 2
  • superset-frontend/src/components/LastQueriedLabel/index.tsx - 1
  • superset/common/utils/query_cache_manager.py - 1
    • Incorrect cache persistence for queried_dttm · Line 114-114
Additional Suggestions - 3
  • superset/charts/schemas.py - 1
    • Required schema field may lack implementation · Line 1467-1473
      The added queried_dttm field is marked as required=True in the marshmallow schema, meaning it must be present in the response dict during serialization. Since the frontend TypeScript interface already expects this field and test data includes it, the backend code probably sets it—but please confirm the response-building logic includes it to avoid ValidationError. If it's not always available, update the schema to required=False for consistency.
  • superset/common/query_context_processor.py - 1
    • Inconsistent queried_dttm semantics · Line 184-184
      The addition of queried_dttm to the response payload aligns with the schema and frontend expectations, but there's an inconsistency: for fresh queries, it correctly shows the execution time, while for cached results, it shows the cache timestamp instead. This could mislead users about when the query was actually run. Consider updating the caching logic to store and retrieve the original queried_dttm.
  • superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.jsx - 1
    • Hardcoded height constant risk · Line 92-92
      The QUERIED_LABEL_HEIGHT constant is hardcoded to 24, but the LastQueriedLabel component's height depends on theme-based styling (fontSizeSM and sizeUnit), which may not always result in exactly 24px. This could lead to slight height miscalculations in getChartHeight, though Math.max ensures a minimum chart height of 20px.
Review Details
  • Files reviewed - 8 · Commit Range: 0232349..2592b1c
    • superset-frontend/packages/superset-ui-core/src/query/types/QueryResponse.ts
    • superset-frontend/plugins/plugin-chart-table/test/testData.ts
    • superset-frontend/src/components/LastQueriedLabel/index.tsx
    • superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.jsx
    • superset-frontend/src/explore/components/ChartPills.tsx
    • superset/charts/schemas.py
    • superset/common/query_context_processor.py
    • superset/common/utils/query_cache_manager.py
  • Files skipped - 0
  • 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

AI Code Review powered by Bito Logo

@luizotavio32 luizotavio32 marked this pull request as draft January 7, 2026 00:56
@luizotavio32 luizotavio32 marked this pull request as ready for review January 7, 2026 01:15
@luizotavio32 luizotavio32 marked this pull request as draft January 7, 2026 01:34
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 8, 2026
@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 8, 2026

Code Review Agent Run #830853

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx - 1
    • Simplify conditional logic · Line 403-415
      The conditional logic for rendering the LastQueriedLabel can be simplified. The current expression {!chart.chartStatus || chart.chartStatus !== 'loading'} is equivalent to {chart.chartStatus !== 'loading'}, which is clearer and more concise while maintaining the same behavior (show when not loading, including when chartStatus is null/undefined).
Review Details
  • Files reviewed - 8 · Commit Range: 002e6d8..77fc5dd
    • superset-frontend/packages/superset-ui-core/src/query/types/QueryResponse.ts
    • superset-frontend/plugins/plugin-chart-table/test/testData.ts
    • superset-frontend/src/components/LastQueriedLabel/index.tsx
    • superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.jsx
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
    • superset/charts/schemas.py
    • superset/common/query_context_processor.py
    • superset/common/utils/query_cache_manager.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ 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

AI Code Review powered by Bito Logo

@kasiazjc
Copy link
Contributor

kasiazjc commented Jan 8, 2026

From a UX standpoint, this feels like a very specific and potentially noisy piece of information, and not something all users will want to see by default. Because of that, users should have control over its visibility/being able to turn it off or on

Default behavior: This should be turned off by default to avoid introducing unexpected visual changes to existing dashboards. Preserving current layouts and, in general visual consistency is important, esp for production dashboards

Yeah, a dashboard configuration makes sense (off by default). This is a long standing request from our users and an option offered by other BI tools. I do agree though that it might be useful depending on the dashboard type and the frequency of updates.

Agreed.

@kasiazjc @michael-s-molina where should we add the on/off config? We have some options like the dashboard properties modal or the left sidebar that appears when clicking Edit dashboard button

Thanks @michael-s-molina for feedback 🙏

@luizotavio32 My first thought was to actually add it to dashboard properties, but I think it makes much more sense to add it in the dashboard "more" dropdown, since this is already where users manage auto-refresh, force refresh etc, so it's kept in context. I think it could look like this:
image

This could also have a tooltip, but if you think the label is enough I am good with that. If we decide on including tooltip though, we could do something like Displays the “Last queried” timestamp below each chart on the dashboard

In addition, I’ve been thinking about a couple of lightweight enhancements that build on existing patterns:

  • In the chart dropdown on dashboards, we already show “Force refresh” and “Cached X time ago”. We could add a tooltip on hover over the cached text to show the exact query time.
image
  • In dashboard “More” settings, where we have “Refresh dashboard” (essentially the same as force refresh), we could also display “Cached X time ago” underneath, the same as in the chart dropdown. On hover, this could reveal more detail for example, when the dashboard was fully loaded - if it does not make sense to show - let me know!

Wdyt @luizotavio32 @michael-s-molina ?

@michael-s-molina
Copy link
Member

michael-s-molina commented Jan 8, 2026

@kasiazjc I love the idea of the improved tooltips 😍

Regarding the location of the option, there's a fundamental difference with Refresh/Full Screen/Auto interval: these are individual settings for users that are persistent only to the current browser session. I think the timestamp is more of a persistent and dashboard configuration (with permission) setting like the color scheme. My suggestion would be to put this setting under Styling or General Information.

Screenshot 2026-01-08 at 10 08 10

@kasiazjc
Copy link
Contributor

kasiazjc commented Jan 8, 2026

@kasiazjc I love the idea of the improved tooltips 😍

Regarding the location of the option, there's a fundamental difference with Refresh/Full Screen/Auto interval, these are individual settings for users that are persistent only to the current browser session. I think the timestamp is more of a persistent and dashboard configuration (with permission) setting like the color scheme. My suggestion would be to put this setting under Styling or General Information.

Screenshot 2026-01-08 at 10 08 10

That makes sense to me! For some reason thought auto interval is dashboard level setting, not user one. In that case I think I would put it under styling - above CSS.

Side note - I didn't realize this section was being called Styling and to me it doesn't sound right. I think this is because it relates more to purely visual/aesthetic changes if that makes sense (sounds shallow and CSS/timestamp/sound more deep). I would change the title to Customize (which I had in designs, but must have missed the discussion), especially because we use it in explore too in the tabs for visual changes. What do you think? (might be me, so not pushing :D)

@luizotavio32
Copy link
Contributor Author

luizotavio32 commented Jan 8, 2026

Seems to me there're 2 clear next steps:

  1. Add tooltip when hovering over Force Refresh / Cached x Hours ago to show the last queried timestamp
  2. Add config under Dashboard Properties > Styling to set Last Queried at: on charts on/off (off by default)

About:

  • In dashboard “More” settings, where we have “Refresh dashboard” (essentially the same as force refresh), we could also display “Cached X time ago” underneath, the same as in the chart dropdown. On hover, this could reveal more detail for example, when the dashboard was fully loaded - if it does not make sense to show - let me know!

If you're ok with it, I'd leave it for another PR since it's a change more related to dashboards instead of charts.

@kasiazjc @michael-s-molina what do you think?

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

CodeAnt AI is running Incremental review


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

@rusackas
Copy link
Member

rusackas commented Jan 8, 2026

My question here is if people need to see the full timestamp all the time, of if we should make the chart display a tooltip that appears on an ℹ icon in the chart header. There, we could have the tooltip show the update time, but potentially add other details too (chart certification, author/owner, datasets used... )

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 8, 2026

Code Review Agent Run #7d69f6

Actionable Suggestions - 0
Additional Suggestions - 1
  • superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx - 1
    • I18n concatenation issue · Line 368-368
      The tooltip title concatenates a translated string with a hardcoded colon, which isn't ideal for internationalization. Consider using `t('Last queried at: %s', queriedLabel)` instead to keep punctuation within the translatable string.
      Code suggestion
       @@ -364,3 +364,3 @@
                <Tooltip
      -          title={queriedLabel ? `${t('Last queried at')}: ${queriedLabel}` : ''}
      +          title={queriedLabel ? t('Last queried at: %s', queriedLabel) : ''}
                  overlayStyle={{ maxWidth: 'none' }}
Review Details
  • Files reviewed - 11 · Commit Range: 77fc5dd..8e09e63
    • superset-frontend/packages/superset-ui-core/src/query/types/QueryResponse.ts
    • superset-frontend/plugins/plugin-chart-table/test/testData.ts
    • superset-frontend/src/components/LastQueriedLabel/index.tsx
    • superset-frontend/src/dashboard/components/SliceHeader/index.tsx
    • superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx
    • superset-frontend/src/dashboard/components/SliceHeaderControls/types.ts
    • superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.jsx
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
    • superset/charts/schemas.py
    • superset/common/query_context_processor.py
    • superset/common/utils/query_cache_manager.py
  • 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

AI Code Review powered by Bito Logo

@michael-s-molina
Copy link
Member

michael-s-molina commented Jan 9, 2026

My question here is if people need to see the full timestamp all the time, of if we should make the chart display a tooltip that appears on an ℹ icon in the chart header. There, we could have the tooltip show the update time, but potentially add other details too (chart certification, author/owner, datasets used... )

Great question @rusackas. I asked AI to analyze both options and also compare with what other BI tools do and the recommendation was:

Always display the "last queried" timestamp directly on each chart with subtle styling, as this maximizes transparency, accessibility, and aligns with best practices in other BI tools.

It's worth noting that many BI tools display the timestamp just once in the dashboard header, but since we allow individual chart refreshes, that approach may not suit our needs. Additionally, with plans to fully virtualize dashboards—where chart queries are triggered only when charts become visible—each chart could have a different timestamp, making per-chart display even more relevant.

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

CodeAnt AI is running Incremental review


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

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 9, 2026

Code Review Agent Run #57b113

Actionable Suggestions - 0
Review Details
  • Files reviewed - 14 · Commit Range: 8e09e63..274c3e2
    • superset-frontend/packages/superset-ui-core/src/query/types/QueryResponse.ts
    • superset-frontend/plugins/plugin-chart-table/test/testData.ts
    • superset-frontend/src/components/LastQueriedLabel/index.tsx
    • superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
    • superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx
    • superset-frontend/src/dashboard/components/SliceHeader/index.tsx
    • superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx
    • superset-frontend/src/dashboard/components/SliceHeaderControls/types.ts
    • superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.jsx
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
    • superset/charts/schemas.py
    • superset/common/query_context_processor.py
    • superset/common/utils/query_cache_manager.py
    • superset/dashboards/schemas.py
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ 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

AI Code Review powered by Bito Logo

@bito-code-review
Copy link
Contributor

bito-code-review bot commented Jan 9, 2026

Code Review Agent Run #203720

Actionable Suggestions - 0
Review Details
  • Files reviewed - 15 · Commit Range: 274c3e2..8cd7963
    • superset-frontend/packages/superset-ui-core/src/query/types/QueryResponse.ts
    • superset-frontend/plugins/plugin-chart-table/test/testData.ts
    • superset-frontend/src/components/LastQueriedLabel/index.tsx
    • superset-frontend/src/dashboard/components/PropertiesModal/index.tsx
    • superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.test.tsx
    • superset-frontend/src/dashboard/components/PropertiesModal/sections/StylingSection.tsx
    • superset-frontend/src/dashboard/components/SliceHeader/index.tsx
    • superset-frontend/src/dashboard/components/SliceHeaderControls/index.tsx
    • superset-frontend/src/dashboard/components/SliceHeaderControls/types.ts
    • superset-frontend/src/dashboard/components/gridComponents/Chart/Chart.jsx
    • superset-frontend/src/explore/components/ExploreChartPanel/index.tsx
    • superset/charts/schemas.py
    • superset/common/query_context_processor.py
    • superset/common/utils/query_cache_manager.py
    • superset/dashboards/schemas.py
  • 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 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

AI Code Review powered by Bito Logo

"annotation_data": self.annotation_data,
"sql_rowcount": self.sql_rowcount,
"queried_dttm": self.queried_dttm,
"dttm": self.queried_dttm, # Backwards compatibility
Copy link
Member

@michael-s-molina michael-s-molina Jan 9, 2026

Choose a reason for hiding this comment

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

Why dttm is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a codent suggestion #36934 (comment)

Copy link
Member

@michael-s-molina michael-s-molina left a comment

Choose a reason for hiding this comment

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

Thank you for the PR @luizotavio32 and thanks @kasiazjc for the inputs!

@michael-s-molina michael-s-molina merged commit 1e8d648 into apache:master Jan 9, 2026
91 of 93 checks passed
@bito-code-review
Copy link
Contributor

Bito Automatic Review Skipped – PR Already Merged

Bito scheduled an automatic review for this pull request, but the review was skipped because this PR was merged before the review could be run.
No action is needed if you didn't intend to review it. To get a review, you can type /review in a comment and save it

michael-s-molina pushed a commit that referenced this pull request Jan 13, 2026
michael-s-molina pushed a commit that referenced this pull request Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages plugins size/L viz:charts Namespace | Anything related to viz types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants