-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for show_col_types for edition 1 parser (#1332)
* Add support for show_col_types for edition 1 parser `read_table()` is one of the functions that currently doesn't have a vroom equivalent, so is still using the first edition parser. When we added support for `show_col_types` we didn't port that back to the first edition parser, so it was missing in `read_table()` and the `read_delim_chunked()` functions. Fixes #1331 * Remove should_show_col_types This is the helper we use in vroom, but I think having it in readr would be too confusing because we already have should_show_types * Correct function name * document() * Update NEWS.md * Reformat for readability * Refactor should_show_types(); add tests * Move NEWS bullet Co-authored-by: Jennifer (Jenny) Bryan <[email protected]>
- Loading branch information
Showing
15 changed files
with
172 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# options(readr.show_col_spec) controls column specifications | ||
|
||
Code | ||
out <- read_csv(readr_example("mtcars.csv")) | ||
Message <readr_spec_message> | ||
-- Column specification -------------------------------------------------------- | ||
cols( | ||
mpg = col_double(), | ||
cyl = col_double(), | ||
disp = col_double(), | ||
hp = col_double(), | ||
drat = col_double(), | ||
wt = col_double(), | ||
qsec = col_double(), | ||
vs = col_double(), | ||
am = col_double(), | ||
gear = col_double(), | ||
carb = col_double() | ||
) | ||
|
||
# `show_col_types` controls column specification | ||
|
||
Code | ||
out <- read_csv(readr_example("mtcars.csv"), show_col_types = TRUE) | ||
Message <readr_spec_message> | ||
-- Column specification -------------------------------------------------------- | ||
cols( | ||
mpg = col_double(), | ||
cyl = col_double(), | ||
disp = col_double(), | ||
hp = col_double(), | ||
drat = col_double(), | ||
wt = col_double(), | ||
qsec = col_double(), | ||
vs = col_double(), | ||
am = col_double(), | ||
gear = col_double(), | ||
carb = col_double() | ||
) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# options(readr.show_col_spec) controls column specifications | ||
|
||
Code | ||
out <- read_csv(readr_example("mtcars.csv")) | ||
Message <vroom_dim_message> | ||
Rows: 32 Columns: 11 | ||
Message <vroom_spec_message> | ||
-- Column specification -------------------------------------------------------- | ||
Delimiter: "," | ||
dbl (11): mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb | ||
i Use `spec()` to retrieve the full column specification for this data. | ||
i Specify the column types or set `show_col_types = FALSE` to quiet this message. | ||
|
||
# `show_col_types` controls column specification | ||
|
||
Code | ||
out <- read_csv(readr_example("mtcars.csv"), show_col_types = TRUE) | ||
Message <vroom_dim_message> | ||
Rows: 32 Columns: 11 | ||
Message <vroom_spec_message> | ||
-- Column specification -------------------------------------------------------- | ||
Delimiter: "," | ||
dbl (11): mpg, cyl, disp, hp, drat, wt, qsec, vs, am, gear, carb | ||
i Use `spec()` to retrieve the full column specification for this data. | ||
i Specify the column types or set `show_col_types = FALSE` to quiet this message. | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
pre_test_options <- options( | ||
readr.show_col_types = FALSE, | ||
readr.show_progress = FALSE | ||
) |
Oops, something went wrong.