-
Notifications
You must be signed in to change notification settings - Fork 16.7k
Description
Bug description
In the latest master branch of Apache Superset, datetime-type fields exhibit inconsistent and incorrect behavior when used in visualizations, compared to raw SQL queries in SQL Lab:
SQL Lab: When executing a raw SELECT query on a table containing datetime data, the time values are returned correctly as stored in the database.
Datasets & Charts: When the same data is used to create a dataset and visualizations (eg:Bar Charts, Scatter Plots):
The datetime values displayed on the chart are incorrect.
The time deviation is inconsistent across different data points. Some timestamps are shifted by hours, while others are shifted by days, with no uniform offset.
Concrete example from the provided screenshots:
This discrepancy breaks the reliability of time-based visualizations and makes it impossible to trust the results.
Expected Behavior
Datetime fields should display consistent, correct time values in both SQL Lab and all visualizations, regardless of the time grain or grouping used.
The time shown in the chart should exactly match the time returned by the raw SQL query.
Actual Behavior
SQL Lab: Time values are correct and match the source data.
Charts:
Time values are incorrect and do not reflect the source data.
Deviations are inconsistent across different data points, with shifts of varying hours and even days.
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- I have searched Superset docs and Slack and didn't find a solution to my problem.
- I have searched the GitHub issue tracker and didn't find a similar bug report.
- I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.