Allow NULL
dimnames to propagate through new_table()
#1889
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.
R-devel failures:
I have tracked this down to this undocumented R-devel change:
wch/r-source@2653cc6#diff-dbc5252913c71f32fa7295e497486c4c2b07ff43aa51b25c33e4dbdd397d3714R1249-R1253
This applies to
dim<-
andRf_setAttrib(*, R_DimSymbol, *)
, which is what causes us issues.Previously, in #1230 we were fairly aggressive about making the
dimnames
attribute returned fromnew_table()
type stable, i.e. always alist()
with eitherNULL
or character vector elements.This causes us some grief in
vec_ptype2.table.table()
because of the wayRf_setAttrib(*, R_DimSymbol, *)
changed:In R release:
vec_ptype2(tbl[, 2], tbl[, 2])
are combined, there is nodimnames
attributevec_ptype2(tbl[, 1], tbl[, 2])
are combined, there is nodimnames
attributeIn R-devel:
vec_ptype2(tbl[, 2], tbl[, 2])
are combined, we getlist(NULL, NULL)
dimnames (from our attempt to type stabilize them innew_table()
+ R-devel leaving them alone since the dimensions are the same)vec_ptype2(tbl[, 1], tbl[, 2])
are combined, there is nodimnames
attributeI think the easiest thing to do is to just say that
new_table()
propagatesNULL
dimnames untouched, resulting in no dimnames attribute. I don't thinkvec_ptype2()
should ever return any "names" related information, so this ensures we consistently don't add adimnames
attribute in R-devel and R-release.