Repository navigation
fix: suppress spurious warning when col_select skips all columns - #627
Closed
LeonidasZhak wants to merge 3 commits into
Closed
LeonidasZhak wants to merge 3 commits into
LeonidasZhak wants to merge 3 commits into
Conversation
The %e format specifier (day with optional leading space) required exactly 2 characters to be consumed because consumeIntegerWithSpace called consumeInteger with the default exact=true. This caused single-digit days like '1' to fail parsing even though the format is designed to accept them. Fix by passing exact=false to consumeInteger, matching the behavior of %d which already uses exact=false. Fixes tidyverse/readr#1559
Update README to clarify that readr's second edition (version 2.0.0 and later) uses vroom::vroom() as its parsing engine by default. Fixes #585
When col_select results in all columns being skipped (e.g. via any_of() with non-existent columns), summary.col_spec() now returns early instead of calling min() on an empty vector, which produced a confusing 'no non-missing arguments to min' warning. Fixes #521
|
|
||
| # any_of() with non-existent columns should return empty tibble without warning | ||
| expect_no_warning( | ||
| result <- vroom(I(foo), delim = ",", col_select = any_of("d"), show_col_types = FALSE) |
There was a problem hiding this comment.
[air] reported by reviewdog 🐶
Suggested change
| result <- vroom(I(foo), delim = ",", col_select = any_of("d"), show_col_types = FALSE) | |
| result <- vroom( | |
| I(foo), | |
| delim = ",", | |
| col_select = any_of("d"), | |
| show_col_types = FALSE | |
| ) |
|
|
||
| # any_of() with existing columns should work normally | ||
| expect_no_warning( | ||
| result <- vroom(I(foo), delim = ",", col_select = any_of("a"), show_col_types = FALSE) |
There was a problem hiding this comment.
[air] reported by reviewdog 🐶
Suggested change
| result <- vroom(I(foo), delim = ",", col_select = any_of("a"), show_col_types = FALSE) | |
| result <- vroom( | |
| I(foo), | |
| delim = ",", | |
| col_select = any_of("a"), | |
| show_col_types = FALSE | |
| ) |
Author
|
I am withdrawing this PR as part of a broader cleanup of an oversized automated contribution batch. I am sorry for the review noise and the pressure this may have put on maintainers. Going forward I will keep contributions to this project much more limited and higher-signal, ideally only one or two focused PRs at a time. Thank you for maintaining the project. |
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.
Summary
When
col_selectresults in all columns being skipped (e.g. viaany_of()with non-existent columns),summary.col_spec()now returns early instead of callingmin()on an empty vector, which produced a confusing "no non-missing arguments to min" warning.Fixes #521
Reprex
Changes
R/col_types.R: Add early return insummary.col_spec()when all columns are skippedtests/testthat/test-vroom.R: Add test forany_of()with non-existent columnsTests run
devtools::test(filter = "vroom"): 514 passed, 0 faileddevtools::test(filter = "col_types"): 14 passed, 0 failedRelated