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/12 07:10:46 UTC

[I] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

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

   ### 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:
   
   <img width="1123" height="789" alt="Image" src="https://github.com/user-attachments/assets/c989d9ec-cc2e-4e5f-9686-add3aaf40dee" />
   
   <img width="1271" height="684" alt="Image" src="https://github.com/user-attachments/assets/fed38cef-cbd8-431c-b692-7895420245ba" />
   
   <img width="1278" height="665" alt="Image" src="https://github.com/user-attachments/assets/7726e88d-79f2-4492-8207-fbb51b51aadf" />
   
   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.


-- 
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] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #37925:
URL: https://github.com/apache/superset/issues/37925#issuecomment-5124424449

   Sorry this sat without a maintainer response despite the pings. The `normalize_dttm_col` theory looks plausible given your repro (UTC offset, no time comparison, second-level grain). I'll get a test written against that function with your config to confirm before scoping a fix.


-- 
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] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

Posted by "Alice-608 (via GitHub)" <gi...@apache.org>.
Alice-608 commented on issue #37925:
URL: https://github.com/apache/superset/issues/37925#issuecomment-3889887947

   @dosu
   Thank you for your response and suggestions! 
   Upon further investigation, I found that the core characteristics of this issue do not align with the assumption of "incorrect dataset-level offset configuration":
   In the Bar Chart and Scatter Plots, the time offset for each data point is completely inconsistent, with no uniform pattern:
   Original time 2026-02-15 16:30:00 → Displayed in chart as 2026-02-16 09:00:00 (offset of ~+16.5 hours)
   Original time 2026-02-15 10:00:00 → Displayed in chart as 2026-02-15 20:00:00 (offset of +10 hours)
   Original time 2026-02-11 14:20:00 → Displayed in chart as 2026-02-12 04:40:00 (offset of ~+14.33 hours)
   This phenomenon of inconsistent time offsets per data point clearly cannot be explained by a "unified offset configuration." Instead, it appears to be a non-deterministic conversion error introduced in the time-handling logic of the master branch.


-- 
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] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

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

   <!-- Answer -->
   You're right—what you're seeing can't be explained by a unified offset or time zone config. Superset's chart pipeline applies normalization and offset logic to datetime columns that SQL Lab does not, but those should always result in consistent, uniform shifts if configured correctly.
   
   The inconsistent, per-row time shifts you describe point to a bug in the backend's time-handling logic for visualizations. In the master branch, chart queries go through a normalization step (normalize_dttm_col) that applies dataset offsets and time shifts, and—if time comparisons are enabled—joins additional offset DataFrames using generated join keys based on the time grain. If there's a bug in how these join keys are generated or how offsets are parsed/applied, it can cause non-uniform, even non-deterministic, shifts per data point, exactly as you describe. This logic is separate from SQL Lab, which just returns raw database values without any of these transformations.
   
   Recent changes to time offset and comparison logic (including PRs like #30002 and #37698) have made this code more complex, especially around parsing human-readable time shifts and joining offset DataFrames. If the join columns or offset calculations are misaligned, you can get the kind of inconsistent results you're seeing ([backend code reference](https://github.com/apache/superset/blob/master/superset/common/query_context_processor.py), [offset normalization](https://github.com/apache/superset/blob/master/superset/utils/core.py), [date parsing](https://github.com/apache/superset/blob/master/superset/utils/date_parser.py)).
   
   To debug, I'd suggest: 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. If you can, try to isolate a minimal dataset and chart config that reproduces the issue, and see if the problem persists with different time grains or after disabling time comparisons.
   
   This looks like a regression or subtle bug in the time offset/join logic for chart queries, not a config issue.
   
   
   <!-- 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/7bf9f2ee-aef5-4dcc-abe7-8f1947f7e323?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/7bf9f2ee-aef5-4dcc-abe7-8f1947f7e323?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/7bf9f2ee-aef5-4dcc-abe7-8f1947f7e323?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/7bf9f2ee-aef5-4dcc-abe7-8f1947f7e323?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7bf9f2ee-aef5-4dcc-abe7-8f1947f7e323?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/7bf9f2ee-aef5-4dcc-abe7-8f1947f7e323?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7bf9f2ee-aef5-4dcc-abe7-8f1947f7e323?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=You%27re%20right%E2%80%94what%20you%27re%20seeing%20can%27t%20be%20explained%20by%20a%20unified%20offset%20or%20time%20zone%20config.%20Superset%27s%20chart%20pipeline%20applies%20normalization%20and%20offset%20logic%20to%20datetime%20columns%20that%20SQL%20Lab%20does%20not%2C%20but%20those%20should%20always%20result%20in%20consistent%2C%20uniform%20shifts%20if%20configured%20correctly.%0A%0AThe%20inconsistent%2C%20per-row%20time%20shifts%20you%20describe%20point%20to%20a%20bug%20in%20the%20backend%27s%20time-handling%20logic%20for%20visualizations.%20In%20the%20master%20branch%2C%20chart%20queries%20go%20through%20a%20normalization%20step%20%28normalize_dttm_col%29%20that%20applies%20dataset%20offsets%20and%20time%20shifts%2C%20and%E2%80%94if%20ti
 me%20comparisons%20are%20enabled%E2%80%94joins%20additional%20offset%20DataFrames%20using%20generated%20join%20keys%20based%20on%20the%20time%20grain.%20If%20there%27s%20a%20bug%20in%20how%20these%20join%20keys%20are%20generated%20or%20how%20offsets%20are%20parsed/applied%2C%20it%20can%20cause%20non-uniform%2C%20even%20non-deterministic%2C%20shifts%20per%20data%20point%2C%20exactly%20as%20you%20describe.%20This%20logic%20is%20separate%20from%20SQL%20Lab%2C%20which%20just%20returns%20raw%20database%20values%20without%20any%20of%20these%20transformations.%0A%0ARecent%20changes%20to%20time%20offset%20and%20comparison%20logic%20%28including%20PRs%20like%20%2330002%20and%20%2337698%29%20have%20made%20this%20code%20more%20complex%2C%20especially%20around%20parsing%20human-readable%20time%20shifts%20and%20joining%20offset%20DataFrames.%20If%20the%20join%20columns%20or%20offset%20calculations%20are%20misaligned%2C%20you%20can%20get%20the%20kind%20of%20inconsistent%20results%20you%27re%20see
 ing%20%28%5Bbackend%20code%20reference%5D%28https%3A//github.com/apache/superset/blob/master/superset/common/query_context_processor.py%29%2C%20%5Boffset%20normalization%5D%28https%3A//github.com/apache/superset/blob/master/superset/utils/core.py%29%2C%20%5Bdate%20parsing%5D%28https%3A//github.com/apache/superset/blob/master/superset/utils/date_parser.py%29%29.%0A%0ATo%20debug%2C%20I%27d%20suggest%3A%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.%20If%20you%20can%2C%20try%20to%20isolate%20a%20minimal%20dataset%20and%20chart%20config%20that%20reproduces%20the%20issue%2C%20and%20see%20if%20the%20problem%20persists%20with%20different%20time%20grains%20or%20after%20disabling%20time%20comparisons.%0A%0AThis%20looks%20like%20a%20regression%20or%20subtle%20bug%20in%20the%
 20time%20offset/join%20logic%20for%20chart%20queries%2C%20not%20a%20config%20issue.)&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/37925)


-- 
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] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

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

   <!-- Answer -->
   You're welcome! You've done a great job documenting the issue with clear examples of the inconsistent offsets. The maintainers have been tagged and should be able to review and triage this accordingly.
   
   In the meantime, if you discover any additional reproduction details (e.g., specific chart configurations or data patterns that consistently trigger certain offset magnitudes), feel free to add them here—that kind of info can help speed up the debugging process.
   
   
   <!-- 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/029eb076-e46f-4cd3-891b-d71f8ef3429d?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/029eb076-e46f-4cd3-891b-d71f8ef3429d?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/029eb076-e46f-4cd3-891b-d71f8ef3429d?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/029eb076-e46f-4cd3-891b-d71f8ef3429d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/029eb076-e46f-4cd3-891b-d71f8ef3429d?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/029eb076-e46f-4cd3-891b-d71f8ef3429d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/029eb076-e46f-4cd3-891b-d71f8ef3429d?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=You%27re%20welcome%21%20You%27ve%20done%20a%20great%20job%20documenting%20the%20issue%20with%20clear%20examples%20of%20the%20inconsistent%20offsets.%20The%20maintainers%20have%20been%20tagged%20and%20should%20be%20able%20to%20review%20and%20triage%20this%20accordingly.%0A%0AIn%20the%20meantime%2C%20if%20you%20discover%20any%20additional%20reproduction%20details%20%28e.g.%2C%20specific%20chart%20configurations%20or%20data%20patterns%20that%20consistently%20trigger%20certain%20offset%20magnitudes%29%2C%20feel%20free%20to%20add%20them%20here%E2%80%94that%20kind%20of%20info%20can%20help%20speed%20up%20the%20debugging%20process.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/disc
 ord-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/37925)


-- 
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] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

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

   <!-- Answer -->
   The inconsistent datetime shifts you’re seeing in charts versus SQL Lab are caused by dataset-level offset and time shift adjustments applied during visualization processing. SQL Lab returns raw database values, but chart queries go through a normalization step that applies any configured offset (like the “Hours Offset” in the Edit Dataset modal) and time shift metadata to datetime columns. If these settings are misconfigured or set inconsistently, you’ll see unpredictable shifts across data points in charts, while SQL Lab remains unaffected. This is a known issue, especially when working across timezones or using relative time filters, since Superset currently calculates ranges in UTC and doesn’t always display timezone metadata in charts or filters. There’s ongoing work to improve timezone handling and add user timezone selection, but for now, check your dataset’s offset and time shift settings and ensure they’re consistent and correct for your use case. More det
 ails and proposals are discussed [here](https://github.com/apache/superset/issues/35422) and [here](https://github.com/apache/superset/discussions/35295).
   
   
   <!-- 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/4e888ac1-3807-4603-abeb-9a2ab1c99b72?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/4e888ac1-3807-4603-abeb-9a2ab1c99b72?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/4e888ac1-3807-4603-abeb-9a2ab1c99b72?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/4e888ac1-3807-4603-abeb-9a2ab1c99b72?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4e888ac1-3807-4603-abeb-9a2ab1c99b72?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/4e888ac1-3807-4603-abeb-9a2ab1c99b72?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4e888ac1-3807-4603-abeb-9a2ab1c99b72?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=The%20inconsistent%20datetime%20shifts%20you%E2%80%99re%20seeing%20in%20charts%20versus%20SQL%20Lab%20are%20caused%20by%20dataset-level%20offset%20and%20time%20shift%20adjustments%20applied%20during%20visualization%20processing.%20SQL%20Lab%20returns%20raw%20database%20values%2C%20but%20chart%20queries%20go%20through%20a%20normalization%20step%20that%20applies%20any%20configured%20offset%20%28like%20the%20%E2%80%9CHours%20Offset%E2%80%9D%20in%20the%20Edit%20Dataset%20modal%29%20and%20time%20shift%20metadata%20to%20datetime%20columns.%20If%20these%20settings%20are%20misconfigured%20or%20set%20inconsistently%2C%20you%E2%80%99ll%20see%20unpredictable%20shifts%20across%20data%20points%20in%20charts%2C%20while%20SQL%20Lab%20remains%20unaffected.%20This%
 20is%20a%20known%20issue%2C%20especially%20when%20working%20across%20timezones%20or%20using%20relative%20time%20filters%2C%20since%20Superset%20currently%20calculates%20ranges%20in%20UTC%20and%20doesn%E2%80%99t%20always%20display%20timezone%20metadata%20in%20charts%20or%20filters.%20There%E2%80%99s%20ongoing%20work%20to%20improve%20timezone%20handling%20and%20add%20user%20timezone%20selection%2C%20but%20for%20now%2C%20check%20your%20dataset%E2%80%99s%20offset%20and%20time%20shift%20settings%20and%20ensure%20they%E2%80%99re%20consistent%20and%20correct%20for%20your%20use%20case.%20More%20details%20and%20proposals%20are%20discussed%20%5Bhere%5D%28https%3A//github.com/apache/superset/issues/35422%29%20and%20%5Bhere%5D%28https%3A//github.com/apache/superset/discussions/35295%29.)&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://twi
 tter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/37925)


-- 
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] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

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

   <!-- Answer -->
   Thanks for the additional context! With UTC offset set, no time comparison enabled, and second-level granularity, the bug becomes clearer.
   
   **Key insight**: The [normalize_dttm_col function](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/utils/core.py#L1668-L1711) applies the datasource UTC offset unconditionally (regardless of time comparison settings) by parsing timestamps as naive datetimes and then adding offset hours. This logic appears to be misapplying offsets inconsistently across rows, which explains the non-uniform shifts you're seeing.
   
   This aligns with a [related regression in Bar Charts on master](https://github.com/apache/superset/issues/37947#issuecomment-3894691320) where UTC offsets are being incorrectly applied during backend normalization. There's also an [open PR #37014](https://github.com/apache/superset/pull/37014) aimed at fixing timezone offset handling, but it hasn't been merged yet.
   
   **Regarding priority labeling**: I don't have the ability to change issue labels or priority settings—that requires a maintainer with triage permissions. However, you've made a strong case for high priority given that:
   - It's a regression on master
   - It affects core time-based visualization reliability
   - The behavior is non-deterministic and breaks trust in chart output
   
   I'd suggest pinging a maintainer (e.g., @betodealmeida, @villebro, or @dpgaspar) directly to escalate this for triage.
   
   **Temporary workaround**: You might try setting the dataset offset to 0 (no offset) to see if that eliminates the inconsistent shifts, though this may not be viable for your use case.
   
   
   <!-- 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/47a271d1-c1d0-4043-b88e-16ebb8dc56c2?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/47a271d1-c1d0-4043-b88e-16ebb8dc56c2?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/47a271d1-c1d0-4043-b88e-16ebb8dc56c2?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/47a271d1-c1d0-4043-b88e-16ebb8dc56c2?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/47a271d1-c1d0-4043-b88e-16ebb8dc56c2?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/47a271d1-c1d0-4043-b88e-16ebb8dc56c2?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/47a271d1-c1d0-4043-b88e-16ebb8dc56c2?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=Thanks%20for%20the%20additional%20context%21%20With%20UTC%20offset%20set%2C%20no%20time%20comparison%20enabled%2C%20and%20second-level%20granularity%2C%20the%20bug%20becomes%20clearer.%0A%0A%2A%2AKey%20insight%2A%2A%3A%20The%20%5Bnormalize_dttm_col%20function%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/utils/core.py%23L1668-L1711%29%20applies%20the%20datasource%20UTC%20offset%20unconditionally%20%28regardless%20of%20time%20comparison%20settings%29%20by%20parsing%20timestamps%20as%20naive%20datetimes%20and%20then%20adding%20offset%20hours.%20This%20logic%20appears%20to%20be%20misapplying%20offsets%20inconsistently%20across%20rows%2C%20which%20explains%20the%20non-uniform%20shifts%20you%27re%20seei
 ng.%0A%0AThis%20aligns%20with%20a%20%5Brelated%20regression%20in%20Bar%20Charts%20on%20master%5D%28https%3A//github.com/apache/superset/issues/37947%23issuecomment-3894691320%29%20where%20UTC%20offsets%20are%20being%20incorrectly%20applied%20during%20backend%20normalization.%20There%27s%20also%20an%20%5Bopen%20PR%20%2337014%5D%28https%3A//github.com/apache/superset/pull/37014%29%20aimed%20at%20fixing%20timezone%20offset%20handling%2C%20but%20it%20hasn%27t%20been%20merged%20yet.%0A%0A%2A%2ARegarding%20priority%20labeling%2A%2A%3A%20I%20don%27t%20have%20the%20ability%20to%20change%20issue%20labels%20or%20priority%20settings%E2%80%94that%20requires%20a%20maintainer%20with%20triage%20permissions.%20However%2C%20you%27ve%20made%20a%20strong%20case%20for%20high%20priority%20given%20that%3A%0A-%20It%27s%20a%20regression%20on%20master%0A-%20It%20affects%20core%20time-based%20visualization%20reliability%0A-%20The%20behavior%20is%20non-deterministic%20and%20breaks%20trust%20in%20chart%20outpu
 t%0A%0AI%27d%20suggest%20pinging%20a%20maintainer%20%28e.g.%2C%20%40betodealmeida%2C%20%40villebro%2C%20or%20%40dpgaspar%29%20directly%20to%20escalate%20this%20for%20triage.%0A%0A%2A%2ATemporary%20workaround%2A%2A%3A%20You%20might%20try%20setting%20the%20dataset%20offset%20to%200%20%28no%20offset%29%20to%20see%20if%20that%20eliminates%20the%20inconsistent%20shifts%2C%20though%20this%20may%20not%20be%20viable%20for%20your%20use%20case.)&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/37925)


-- 
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] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

Posted by "Alice-608 (via GitHub)" <gi...@apache.org>.
Alice-608 commented on issue #37925:
URL: https://github.com/apache/superset/issues/37925#issuecomment-3948534273

   This issue (#37925) is not the same as #37947 – we see inconsistent datetime offsets (hours/days) in bar/scatter charts (SQL Lab values are correct), breaking time-based visualization reliability. Could you triage this at your convenience?


-- 
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] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

Posted by "Ujjwaljain16 (via GitHub)" <gi...@apache.org>.
Ujjwaljain16 commented on issue #37925:
URL: https://github.com/apache/superset/issues/37925#issuecomment-5939751219

   @rusackas 
   
   I investigated this against current `upstream/master` (`8ab7a85a3d`, 2026-10-01) and could not reproduce the reported datetime shifts.
   
   I ran the three timestamps from the issue through the actual chart query path and JSON serialization with the reported configuration (UTC/zero offset, no time comparison, no time shift, second-level precision). The returned values matched the source values exactly. I also tested multiple grain/format combinations; the only change observed was the expected truncation when using a day-level grain.
   
   One interesting detail from the reported examples is that the stated shift for each row equals that row's own time-of-day:
   
   ```text
   16:30:00 → +16:30
   10:00:00 → +10:00
   14:20:00 → +14:20
   ```
   
   That corresponds to `displayed = date + 2 × time-of-day`, which cannot be produced by a normal fixed datasource offset or `time_shift`. The `normalize_dttm_col` regression test added in #42589 also passes and confirms that zero offset/no time shift preserves these exact values.
   
   I also checked the relevant datetime changes around #37925 (#37979, #37111, #35042, #37014) and did not find a current code path that explains this behavior.
   
   At this point I can't identify a current Superset defect from the available reproduction. The following would help narrow down where the discrepancy occurs:
   
   1. The dataset's **Hours Offset** and **Timezone** settings.
   2. Whether the chart's datetime column is a physical column or a calculated/virtual column.
   3. The actual `/api/v1/chart/data` response containing the affected rows.
   4. Confirmation that SQL Lab and the chart are selecting the same column/expression.
   5. The actual Superset version being used for the original reproduction.
   
   The chart API response in particular would distinguish a backend/query-result discrepancy from a frontend rendering issue.


-- 
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] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

Posted by "Alice-608 (via GitHub)" <gi...@apache.org>.
Alice-608 commented on issue #37925:
URL: https://github.com/apache/superset/issues/37925#issuecomment-3949460082

   @dosu 
   Thank you for the thorough investigation and clear root cause analysis.
   
   Based on your confirmation that this is a regression on the master branch affecting core time‑based visualizations, could the maintainers @betodealmeida @villebro @dpgaspar help triage this issue and mark it as high priority? This bug causes inconsistent and unreliable datetime rendering across charts, which is critical for our usage.
   
   Thanks again for your support!


-- 
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] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

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

   <!-- Answer -->
   Thanks for the clarification. Based on my investigation, this does appear to be a distinct bug from #37947, though they share the same root cause: **chart queries apply datetime normalization transformations that SQL Lab does not**.
   
   **Root Cause**: The inconsistent, non-uniform time shifts (+16.5h, +10h, +14.33h) you're seeing suggest multiple offset layers are being conditionally applied based on data point characteristics. Charts invoke [`normalize_dttm_col()`](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/utils/core.py#L1668-L1711) through the [QueryContextProcessor](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/common/query_context_processor.py#L287), while SQL Lab bypasses this entirely and returns raw database values.
   
   **Why non-uniform offsets occur**: The normalization pipeline applies up to three offset layers sequentially:
   1. Datasource offset (hours) via `datasource.offset`
   2. Query time shift via `parse_human_timedelta()`
   3. Time comparison offsets during [join column generation](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/common/query_context_processor.py#L698-L732)
   
   If any of these layers are applied conditionally (e.g., based on format detection or aggregation boundaries), you get inconsistent shifts per row.
   
   **Relevant recent regressions**: Several PRs have touched this code path recently:
   - [PR #37979](https://github.com/apache/superset/pull/37979) - Fixed timezone conversion bugs
   - [PR #37111](https://github.com/apache/superset/pull/37111) - Fixed time comparison join key regression
   - [PR #35042](https://github.com/apache/superset/pull/35042) - Refactored `normalize_dttm_col` format detection
   
   **Triage Recommendation**: This should be labeled as a **bug** with **high priority** since it breaks time-based visualization reliability. It's likely a regression in the datetime normalization logic on master. To help debug further, could you share:
   1. Your dataset's offset configuration (if any)
   2. Whether time comparisons are enabled on these charts
   3. The time grain setting you're using
   
   
   <!-- 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/00aca72f-69b0-44df-9b6a-a5c0e2e4a2ba?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/00aca72f-69b0-44df-9b6a-a5c0e2e4a2ba?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/00aca72f-69b0-44df-9b6a-a5c0e2e4a2ba?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/00aca72f-69b0-44df-9b6a-a5c0e2e4a2ba?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/00aca72f-69b0-44df-9b6a-a5c0e2e4a2ba?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/00aca72f-69b0-44df-9b6a-a5c0e2e4a2ba?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/00aca72f-69b0-44df-9b6a-a5c0e2e4a2ba?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=Thanks%20for%20the%20clarification.%20Based%20on%20my%20investigation%2C%20this%20does%20appear%20to%20be%20a%20distinct%20bug%20from%20%2337947%2C%20though%20they%20share%20the%20same%20root%20cause%3A%20%2A%2Achart%20queries%20apply%20datetime%20normalization%20transformations%20that%20SQL%20Lab%20does%20not%2A%2A.%0A%0A%2A%2ARoot%20Cause%2A%2A%3A%20The%20inconsistent%2C%20non-uniform%20time%20shifts%20%28%2B16.5h%2C%20%2B10h%2C%20%2B14.33h%29%20you%27re%20seeing%20suggest%20multiple%20offset%20layers%20are%20being%20conditionally%20applied%20based%20on%20data%20point%20characteristics.%20Charts%20invoke%20%5B%60normalize_dttm_col%28%29%60%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/utils/core.
 py%23L1668-L1711%29%20through%20the%20%5BQueryContextProcessor%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/common/query_context_processor.py%23L287%29%2C%20while%20SQL%20Lab%20bypasses%20this%20entirely%20and%20returns%20raw%20database%20values.%0A%0A%2A%2AWhy%20non-uniform%20offsets%20occur%2A%2A%3A%20The%20normalization%20pipeline%20applies%20up%20to%20three%20offset%20layers%20sequentially%3A%0A1.%20Datasource%20offset%20%28hours%29%20via%20%60datasource.offset%60%0A2.%20Query%20time%20shift%20via%20%60parse_human_timedelta%28%29%60%0A3.%20Time%20comparison%20offsets%20during%20%5Bjoin%20column%20generation%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/common/query_context_processor.py%23L698-L732%29%0A%0AIf%20any%20of%20these%20layers%20are%20applied%20conditionally%20%28e.g.%2C%20based%20on%20format%20detection%20or%20aggregation%20boundaries%29%2C%20you%20get%20inconsistent%
 20shifts%20per%20row.%0A%0A%2A%2ARelevant%20recent%20regressions%2A%2A%3A%20Several%20PRs%20have%20touched%20this%20code%20path%20recently%3A%0A-%20%5BPR%20%2337979%5D%28https%3A//github.com/apache/superset/pull/37979%29%20-%20Fixed%20timezone%20conversion%20bugs%0A-%20%5BPR%20%2337111%5D%28https%3A//github.com/apache/superset/pull/37111%29%20-%20Fixed%20time%20comparison%20join%20key%20regression%0A-%20%5BPR%20%2335042%5D%28https%3A//github.com/apache/superset/pull/35042%29%20-%20Refactored%20%60normalize_dttm_col%60%20format%20detection%0A%0A%2A%2ATriage%20Recommendation%2A%2A%3A%20This%20should%20be%20labeled%20as%20a%20%2A%2Abug%2A%2A%20with%20%2A%2Ahigh%20priority%2A%2A%20since%20it%20breaks%20time-based%20visualization%20reliability.%20It%27s%20likely%20a%20regression%20in%20the%20datetime%20normalization%20logic%20on%20master.%20To%20help%20debug%20further%2C%20could%20you%20share%3A%0A1.%20Your%20dataset%27s%20offset%20configuration%20%28if%20any%29%0A2.%20Whether%20time%20c
 omparisons%20are%20enabled%20on%20these%20charts%0A3.%20The%20time%20grain%20setting%20you%27re%20using)&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/37925)


-- 
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] master branch: datetime field shows incorrect time in Bar Charts and Scatter Plot with inconsistent deviations (vs correct time in SQL Lab) [superset]

Posted by "Alice-608 (via GitHub)" <gi...@apache.org>.
Alice-608 commented on issue #37925:
URL: https://github.com/apache/superset/issues/37925#issuecomment-3948912940

   @dosu 
   Thank you for the detailed analysis.
   
   To help with further debugging:
   - Datasource offset: UTC
   - Time comparison / Time shift: Not enabled
   - Time granularity: yyyy-MM-dd HH:mm:ss (precision to the second)
   
   Since this bug causes inconsistent datetime values across visualizations and breaks the reliability of all time-based charts, could you please help mark this issue as high priority?  It’s a regression in the master branch and affects core visualization functionality.


-- 
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