Repository navigation
Conversation
Member
|
Closing this PR as it doesn't meet our guidelines on AI-generated contributions: https://arrow.apache.org/docs/developers/overview.html#ai-generated-code If you'd like to contribute this change, please review and test the code yourself, then open a new PR. |
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.
Rationale for this change
An R
Datecan contain infinity or NaN. On Windows with Arrow 26.0.1.1, converting any of those values to a table, or writing and reading it through Feather or Parquet, produced a date 2,147,483,648 days before the epoch. A date comparison can then return the wrong answer.What changes are included in this PR?
Check that the day or millisecond count fits the signed storage type before casting it. R's
NAstill produces an Arrow null. NaN, either infinity and finite dates outside the storage range raise a conversion error. This preserves the R binding's distinction betweenNAand NaN.Are these changes tested?
Yes. The regression covers both Arrow date types, ordinary dates on either side of the epoch, missing dates, NaN, both infinities and storage limits. I built the patched R package on Windows with R 4.6.2. The Array test file passed 1,189 expectations with 10 skips. I also verified the table, Feather V2 and Parquet examples before and after the change.
Are there any user-facing changes?
This PR contains a Critical Fix. Previously, converting an unrepresentable R date could write a finite date into the output. Conversion now reports the value and target type.
Was AI used for this PR?
OpenAI Codex wrote the code, regression tests and PR description. Codex also reviewed the change and ran the tests.
PR code and description written by
Reviewed before submission by
Closes #49836.