GH-43748: [R] Handle package_version in safe_r_metadata #43895
Merged
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
See #43748. There is what appears to be a bug in R's
[[.numeric_version
implementation that leads to infinite recursion.Edit: after some digging in R source, this appears to be as designed. And other list subclasses that have methods to make them behave like atomic types, like
POSIXlt
, also have this.What changes are included in this PR?
When recursing into list objects,
unclass()
them first to get the raw list behavior. Also apply the checking to theattributes()
before reapplying them.Are these changes tested?
yes
Are there any user-facing changes?
Fewer bugs!
write_parquet()
has infinite recursion error when writingpackageVersion()
attributes #43748