You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "matthewgson (via GitHub)" <gi...@apache.org> on 2024/09/17 00:54:38 UTC
[I] R arrow column selection bug with tidyselect [arrow]
matthewgson opened a new issue, #44138:
URL: https://github.com/apache/arrow/issues/44138
### Describe the bug, including details regarding any error messages, version, and platform.
The column selection with `select()` in combination with `tidyselect` generates a bug when multiple arguments are passed to select().
Reprex:
```r
library(arrow)
library(tidyverse)
iris_arrow <- as_arrow_table(iris)
iris_arrow |>
select(!ends_with(".Length"),
!Sepal.Width) |>
names()
[1] "Sepal.Width" "Petal.Width" "Species" "Sepal.Length" "Petal.Length"
```
In this example, even though Sepal.Width is supposed to be excluded, it still appears in the result.
A current workaround is to split `select()` function calls with pipe:
```r
iris_arrow |>
select(!ends_with(".Length")) |>
select(!Sepal.Width) |>
names()
[1] "Petal.Width" "Species"
```
The same occurs when data is transferred to `duckdb`:
```r
iris_db <- iris_arrow |> to_duckdb()
iris_db |>
select(!ends_with(".Length"),
!Sepal.Width) |>
colnames() # why names() doesn't work?
[1] "Sepal.Width" "Petal.Width" "Species" "Sepal.Length" "Petal.Length"
```
SessionInfo:
```r
sessionInfo()
R version 4.4.1 (2024-06-14)
Platform: aarch64-apple-darwin20
Running under: macOS Sonoma 14.6.1
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: America/New_York
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] lubridate_1.9.3 forcats_1.0.0 stringr_1.5.1 dplyr_1.1.4 purrr_1.0.2 readr_2.1.5 tidyr_1.3.1
[8] tibble_3.2.1 ggplot2_3.5.1 tidyverse_2.0.0 arrow_16.1.0
loaded via a namespace (and not attached):
[1] bit_4.0.5 gtable_0.3.5 compiler_4.4.1 tidyselect_1.2.1 assertthat_0.2.1 scales_1.3.0
[7] R6_2.5.1 generics_0.1.3 munsell_0.5.1 DBI_1.2.3 pillar_1.9.0 tzdb_0.4.0
[13] rlang_1.1.4 utf8_1.2.4 stringi_1.8.4 bit64_4.0.5 timechange_0.3.0 cli_3.6.3
[19] withr_3.0.1 magrittr_2.0.3 grid_4.4.1 dbplyr_2.5.0 hms_1.1.3 lifecycle_1.0.4
[25] vctrs_0.6.5 glue_1.7.0 data.table_1.15.4 duckdb_1.0.0-2 fansi_1.0.6 colorspace_2.1-1
[31] tools_4.4.1 pkgconfig_2.0.3
```
### Component(s)
R
--
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: issues-unsubscribe@arrow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [R] R arrow column selection bug with tidyselect [arrow]
Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba commented on issue #44138:
URL: https://github.com/apache/arrow/issues/44138#issuecomment-2356974059
Thanks for taking the time to file a detailed issue @matthewgson.
It looks to me like this is more of a fundamental behavior of dplyr/tidyselect since I can reproduce this without arrow/duckdb/dbplyr:
```r
> library(dplyr)
>
> iris |>
+ select(
+ !ends_with(".Length"), !Sepal.Width) |>
+ names()
[1] "Sepal.Width" "Petal.Width" "Species" "Sepal.Length" "Petal.Length"
```
It's not clear from the help page for `select` whether that's a bug or not but I don't think it's something we that can be fixed in arrow.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] R arrow column selection bug with tidyselect [arrow]
Posted by "eitsupi (via GitHub)" <gi...@apache.org>.
eitsupi commented on issue #44138:
URL: https://github.com/apache/arrow/issues/44138#issuecomment-2354420305
This looks like a bug that exists in both `arrow` and `dbplyr` and should probably be reported to https://github.com/tidyverse/dbplyr/ too.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [R] R arrow column selection bug with tidyselect [arrow]
Posted by "amoeba (via GitHub)" <gi...@apache.org>.
amoeba closed issue #44138: [R] R arrow column selection bug with tidyselect
URL: https://github.com/apache/arrow/issues/44138
--
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: issues-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org