You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Alice-608 (via GitHub)" <gi...@apache.org> on 2026/02/13 03:36:37 UTC

[I] [Bug] : Incorrect Datetime Conversion When Switching Display Formats in Bar Chart (Latest Master Branch) [superset]

Alice-608 opened a new issue, #37947:
URL: https://github.com/apache/superset/issues/37947

   ### Bug description
   
   Describe the bug
   When working with datetime columns in a Bar Chart (and potentially other chart types) in the latest master branch of Apache Superset, switching between different datetime display formats results in an incorrect Unix timestamp conversion, leading to a significant time discrepancy.
   
   To Reproduce
   Create a Bar Chart in Superset using a dataset containing a datetime column (e.g., 2026-02-15 16:30:00).
   In the chart's configuration panel, switch the datetime display format between the available options.
   Observe the resulting Unix timestamp value displayed after the format switch.
   
   Expected behavior
   The converted Unix timestamp should accurately represent the original datetime value. For the example 2026-02-15 16:30:00, the correct timestamp (in milliseconds) is 1771144200000.
   
   Actual behavior
   When switching formats, the resulting timestamp is 1771173000000. When converted back to a datetime, this corresponds to 2026-02-16 00:30:00, which is 8 hours later than the original datetime 2026-02-15 16:30:00. This indicates a critical error in the timezone handling or conversion logic when switching display formats.
   
   Screenshots
   
   <img width="1023" height="505" alt="Image" src="https://github.com/user-attachments/assets/e21eede5-92c7-44b8-a0ca-4ef6990a61ed" />
   
   <img width="1017" height="501" alt="Image" src="https://github.com/user-attachments/assets/f7cbf019-da12-41ec-8a7e-d08f73b0e872" />
   
   <img width="1705" height="838" alt="Image" src="https://github.com/user-attachments/assets/4c4404c1-bdc1-4ed8-97b2-da08c2b066e4" />
   
   ### 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] [Bug] : Incorrect Datetime Conversion When Switching Display Formats in Bar Chart (Latest Master Branch) [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #37947:
URL: https://github.com/apache/superset/issues/37947#issuecomment-3894691320

   <!-- Answer -->
   This is a known regression in the latest master branch: Bar Charts (and some other visualizations) can show incorrect and inconsistent datetime shifts due to how Superset applies dataset-level offsets and time shifts during backend normalization, which are not applied in SQL Lab. This normalization step can introduce non-uniform time deviations—sometimes by hours, sometimes by days—if there’s a bug in how offsets or join keys are generated for time grains. The frontend display format switch just toggles between raw and formatted values, but the underlying timestamp may already be shifted by the backend logic. 
   
   Recent changes to time offset and comparison logic have made this code more complex and may have introduced these bugs. To debug, inspect the DataFrame before and after normalization/offset application in the backend, check if offsets are being double-applied or misapplied, and review how join keys are generated for your time grain. This is not a config issue, but a subtle bug in the backend’s time-handling logic for visualizations. More details and debugging suggestions are in [this issue thread](https://github.com/apache/superset/issues/37925#issuecomment-3889887947).
   
   If you need a workaround, check your dataset’s offset and time shift settings, and try to isolate a minimal dataset and chart config that reproduces the issue. The frontend logic for switching display formats is not the root cause, but it exposes the backend bug.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/b3c31ce4-e2ab-48c8-9fdb-1bb69fdce0f9?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/b3c31ce4-e2ab-48c8-9fdb-1bb69fdce0f9?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/b3c31ce4-e2ab-48c8-9fdb-1bb69fdce0f9?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/b3c31ce4-e2ab-48c8-9fdb-1bb69fdce0f9?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/b3c31ce4-e2ab-48c8-9fdb-1bb69fdce0f9?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/b3c31ce4-e2ab-48c8-9fdb-1bb69fdce0f9?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/b3c31ce4-e2ab-48c8-9fdb-1bb69fdce0f9?feedback_type=other)</sup>
   
   [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20is%20a%20known%20regression%20in%20the%20latest%20master%20branch%3A%20Bar%20Charts%20%28and%20some%20other%20visualizations%29%20can%20show%20incorrect%20and%20inconsistent%20datetime%20shifts%20due%20to%20how%20Superset%20applies%20dataset-level%20offsets%20and%20time%20shifts%20during%20backend%20normalization%2C%20which%20are%20not%20applied%20in%20SQL%20Lab.%20This%20normalization%20step%20can%20introduce%20non-uniform%20time%20deviations%E2%80%94sometimes%20by%20hours%2C%20sometimes%20by%20days%E2%80%94if%20there%E2%80%99s%20a%20bug%20in%20how%20offsets%20or%20join%20keys%20are%20generated%20for%20time%20grains.%20The%20frontend%20display%20format%20switch%20just%20toggles%20between%20raw%20and%20formatted%20values%2C%20but%20the%20und
 erlying%20timestamp%20may%20already%20be%20shifted%20by%20the%20backend%20logic.%20%0A%0ARecent%20changes%20to%20time%20offset%20and%20comparison%20logic%20have%20made%20this%20code%20more%20complex%20and%20may%20have%20introduced%20these%20bugs.%20To%20debug%2C%20inspect%20the%20DataFrame%20before%20and%20after%20normalization/offset%20application%20in%20the%20backend%2C%20check%20if%20offsets%20are%20being%20double-applied%20or%20misapplied%2C%20and%20review%20how%20join%20keys%20are%20generated%20for%20your%20time%20grain.%20This%20is%20not%20a%20config%20issue%2C%20but%20a%20subtle%20bug%20in%20the%20backend%E2%80%99s%20time-handling%20logic%20for%20visualizations.%20More%20details%20and%20debugging%20suggestions%20are%20in%20%5Bthis%20issue%20thread%5D%28https%3A//github.com/apache/superset/issues/37925%23issuecomment-3889887947%29.%0A%0AIf%20you%20need%20a%20workaround%2C%20check%20your%20dataset%E2%80%99s%20offset%20and%20time%20shift%20settings%2C%20and%20try%20to%20isolate%
 20a%20minimal%20dataset%20and%20chart%20config%20that%20reproduces%20the%20issue.%20The%20frontend%20logic%20for%20switching%20display%20formats%20is%20not%20the%20root%20cause%2C%20but%20it%20exposes%20the%20backend%20bug.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37947)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [I] [Bug] : Incorrect Datetime Conversion When Switching Display Formats in Bar Chart (Latest Master Branch) [superset]

Posted by "hainenber (via GitHub)" <gi...@apache.org>.
hainenber closed issue #37947: [Bug] : Incorrect Datetime Conversion When Switching Display Formats in Bar Chart (Latest Master Branch)
URL: https://github.com/apache/superset/issues/37947


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org