Skip to content

Commit

Permalink
Revert "Remove data.table from class attribute"
Browse files Browse the repository at this point in the history
This reverts commit 9827ff1.
  • Loading branch information
amoeba committed Jan 24, 2025
1 parent 9827ff1 commit 683f761
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
5 changes: 0 additions & 5 deletions r/R/metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -275,11 +275,6 @@ arrow_attributes <- function(x, only_top_level = FALSE) {
}
}

# GH-45300: Remove data.table from class attribute
if (inherits(x, "data.table")) {
att[["class"]] <- setdiff(att[["class"]], "data.table")
}

att <- att[setdiff(names(att), removed_attributes)]

if (isTRUE(only_top_level)) {
Expand Down
13 changes: 0 additions & 13 deletions r/tests/testthat/test-metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -486,16 +486,3 @@ test_that("data.frame class attribute is not saved", {
df_arrow <- arrow_table(df)
expect_identical(df_arrow$r_metadata, list(attributes = list(foo = "bar"), columns = list(x = NULL)))
})

test_that("we remove the data.table class from metadata", {
skip_if_not_installed("data.table")

tf <- tempfile()
on.exit(unlink(tf))

dt <- data.table::data.table(x = 1:3)
write_parquet(dt, tf)
dt_after <- read_parquet(tf)

expect_false("data.table" %in% attributes(dt_after)$class)
})

0 comments on commit 683f761

Please sign in to comment.