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> [](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github) [](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.) [](https://go.dosu.dev/discord-bot) [](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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
