Skip to content

Commit 12ce0bf

Browse files
committed
Change data frame conversion method
1 parent 4e22f4d commit 12ce0bf

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

r/R/schema.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ as_schema.StructType <- function(x, ...) {
467467

468468
#' @export
469469
as.data.frame.Schema <- function(x, row.names = NULL, optional = FALSE, ...) {
470-
as.data.frame(Table__from_schema(x))
470+
Table__from_schema(x)$to_data_frame()
471471
}
472472

473473
#' @export

r/src/arrowExports.cpp

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

r/tests/testthat/test-dplyr-select.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,16 @@ test_that("multiple select/rename and group_by", {
228228
tbl
229229
)
230230
})
231+
232+
233+
test_that("rename_with does not warn on columns with names metadata - GH48712", {
234+
issue_tbl <- mutate(mtcars, cyl = setNames(cyl, nm = cyl))
235+
236+
out <- expect_no_warning(
237+
arrow_table(issue_tbl) |>
238+
rename_with(toupper) |>
239+
collect()
240+
)
241+
242+
expect_named(out, toupper(names(issue_tbl)))
243+
})

0 commit comments

Comments
 (0)