Repository navigation
Conversation
This branch has not been deployed
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.
When a size error happens in
summarise()orreframe()after anacross()(or an unnamed data frame result) has been expanded, the error handler indexesdotswith a position that counts the expanded columns instead of the original expressions:The C side reports
index_expressionas a position inchunks, which has one entry per expanded column.summarise_cols()now records which expression each chunk came from and maps the index back before building the error context. With this the call above gives the usual recycling error (across(...)must be size 3 or 1, not 12), and the same goes for a bad expression that comes after anacross(), e.g.summarise(df, across(everything(), mean), z = 1:2)now namesz.I ran a set of summarise/reframe calls (across, data frame results,
NULLresults, grouped, errors and successes) before and after. Results are identical; the error messages that changed are the ones that used to hit the subscript error, plus one that used to blame the wrong expression: after anacross()that selects no columns,summarise(df, across(c(), mean), z = 1:2)used to nameacross(c(), mean)and now namesz. There's no measurable slowdown on a 2000 columnacross().The new tests are snapshot tests through
summarise()andreframe(); they fail without the change. The full suite has the same failures on main without this change (all-equal, bind-rows, case-when, recode-values, which look like R 4.6 differences).Closes #7657