thisisnic commented on issue #33625:
URL: https://github.com/apache/arrow/issues/33625#issuecomment-1384525354
This isn't a bug; this is just a consequence of `strings_can_be_null` being
set to TRUE by default. However, it does raise the question of whether we want
this behaviour to differ from readr's or not if the user doesn't know to use
`strings_can_be_null`:
``` r
tf <- tempfile()
dir.create(tf)
path = file.path(tf, "file1.csv")
write.csv(data.frame(x = c(1, 2, NA, 3), y = c("a", NA, "b", "c")), path,
row.names = FALSE)
readr::read_csv(path, na = c("NA", "b"))
#> Rows: 4 Columns: 2
#> ── Column specification
────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (1): y
#> dbl (1): x
#>
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this
message.
#> # A tibble: 4 × 2
#> x y
#> <dbl> <chr>
#> 1 1 a
#> 2 2 <NA>
#> 3 NA <NA>
#> 4 3 c
arrow::read_csv_arrow(path, na = c("na", "b"))
#> # A tibble: 4 × 2
#> x y
#> <chr> <chr>
#> 1 1 a
#> 2 2 NA
#> 3 NA <NA>
#> 4 3 c
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]