Repository navigation
Fix timeline bar lengths across daylight saving changes - #5796
Open
mottopanikeiku wants to merge 2 commits into
Open
mottopanikeiku wants to merge 2 commits into
mottopanikeiku wants to merge 2 commits into
Conversation
I calculate timeline bar lengths in the same local wall-clock coordinates used by date axes, so timezone-aware endpoints remain aligned across daylight saving changes. I leave the original start column unchanged and cover spring, autumn, UTC, and naive timestamps across dataframe backends. Fixes plotly#4611 Signed-off-by: mottopanikeiku <176798723+mottopanikeiku@users.noreply.github.com>
Contributor
|
@mottopanikeiku have you reviewed the code and tests yourself? |
Author
|
@camdecoster i have! its a very small diff hahah like 13 lines |
…ht-saving # Conflicts: # CHANGELOG.md
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue
Closes #4611
Description of change
px.timelinenow calculates bar lengths in the same local wall-clock coordinates that date axes display, so bars with timezone-aware dates no longer end an hour early or late across daylight saving transitions. The original start column and its timezone metadata are unchanged.Demo
For the issue's US/Pacific midnight-to-midnight examples:
Testing strategy
The regression checks bar lengths, start coordinates, and reconstructed endpoints around both transitions, with UTC and timezone-naive controls, across the Polars, PyArrow, and pandas constructors. Before the fix,
pytest tests/test_optional/test_px/test_px_functions.py -k timeline_daylight_savinggave 5 failures (every US/Pacific case off by an hour); after it, the whole file passes (88 passed, 7 skipped, the skips being existing pandas 3/PyArrow hierarchy-chart cases).ruff checkandruff format --checkpass on the changed files.Additional information (optional)
I used AI assistance (OpenAI Codex and Claude) to investigate, implement, and test this change. No new dependencies or public API.
Guidelines