Fix recursive gc error that could occur with POSIXct columns #390
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.
Closes #389
The analysis in this comment was correct #389 (comment), the
output_column()
method for POSIXct was creating another character ALTREP vector aftervroom_convert()
was called.I didn't add a test, because this is hard to test for, but I confirmed that the reprex here no longer errors #389 (comment)
POSIXct isn't necessarily the only type where this could happen.
output_column.POSIXt()
callsformat()
, and what is happening informat()
is:y
y
names<-
at the C level will create an “ALTREP wrapper” aroundy
. It allows you to wrapy
without duplicating it, and then add new attributes on top of it (like names) cheaplystructure()
call informat.POSIXct()
that tries to add names on again to the result offormat.POSIXlt()
. This is probably also creating another ALTREP wrapper layer on top of the first one.So it is entirely possible that other
output_column()
methods could do this, but I don’t think any of the currently implemented ones do.