Repository navigation
Conversation
Contributor
|
Cna you please review this PR and write the docs in your own words -- this is hard to understand LLM speak |
alamb
marked this pull request as draft
November 13, 2026 19:41
What: replaces the two-sentence DST note on date_bin with three short paragraphs: what the origin actually is (a single point in time, not a time of day that repeats), what happens at a daylight saving transition (bins drift off local midnight with no error or warning, same as PostgreSQL and DuckDB), and what to use instead (date_trunc for calendar units, date_bin over to_local_time(t AT TIME ZONE '<zone>') for other strides). Adds the concrete America/Denver example from apache#25168 so the drift is visible rather than only described. Why: review feedback asked for this note to be rewritten in plainer words. How: identical text in the rustdoc and in the generated mirror docs/source/user-guide/sql/scalar_functions.md. No code changes. Signed-off-by: Inf1mum <vadimlazuk5@gmail.com>
Author
|
Rewrote the note in plain words: it now says directly that the origin is a single point in time rather than a repeating time of day, and shows the |
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.
Which issue does this PR close?
date_binwith an explicit origin drifts an hour across a DST transition #25168.Rationale for this change
An explicit
origin_timestampchosen to aligndate_binbins to local midnight works until the timezone's offset changes, then the bins silently shift by an hour. There is no error and no warning. This is not a bug in DataFusion — PostgreSQL and DuckDB return identical results, because all three bin on the instant measured from a fixed origin — but the pattern looks correct in every test that does not cross a DST transition, so the issue asks for it to be documented.What changes are included in this PR?
Adds a short note to the
date_bindocumentation: the origin is a single point in time, not a time of day that repeats, so bins that start at local midnight drift an hour off when daylight saving time changes the timezone's offset — with no error or warning, and with the same result as PostgreSQL and DuckDB. It points users atdate_truncfor calendar units and atdate_bin(<stride>, to_local_time(t AT TIME ZONE '<zone>'))for strides that are not calendar units, and shows theAmerica/Denverexample from #25168.The note is added to the rustdoc in
datafusion/functions/src/datetime/date_bin.rsand mirrored intodocs/source/user-guide/sql/scalar_functions.md(whichdev/update_function_docs.shregenerates from the rustdoc).What is the testing strategy for this PR?
Docs-only change; no code or test behaviour is touched.
cargo test -p datafusion-functions --lib— 410 passed, 0 failed.cargo fmt --checkon the touched crate.Are there any user-facing changes?
Documentation only. No behaviour change, no public API change.