Skip to content

Commit

Permalink
make fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
sorhawell committed Nov 9, 2023
1 parent 4fa1156 commit bf4b410
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions R/parquet.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ pl$read_parquet = function(
row_count_offset = 0L,
# storage_options,#: dict[str, object] | None = None, #seems fsspec specific
low_memory = FALSE,
hive_partitioning = TRUE
) {
hive_partitioning = TRUE) {
mc = match.call()
mc[[1]] = pl$scan_parquet
result(eval(mc)$collect()) |>
Expand Down
12 changes: 4 additions & 8 deletions tests/testthat/test-parquet.R
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@

tmpf = tempfile()
on.exit(unlink(tmpf))
lf_exp = pl$LazyFrame(mtcars)
lf_exp$sink_parquet(tmpf, compression = "snappy")
df_exp = lf_exp$collect()$to_data_frame()
df_exp = lf_exp$collect()$to_data_frame()

test_that("scan read parquet", {

#simple scan
# simple scan
expect_identical(
pl$scan_parquet(tmpf)$collect()$to_data_frame(),
df_exp
Expand All @@ -21,12 +19,12 @@ test_that("scan read parquet", {

# with row count
expect_identical(
pl$read_parquet(tmpf, row_count_name = "rc",row_count_offset = 5)$to_data_frame(),
pl$read_parquet(tmpf, row_count_name = "rc", row_count_offset = 5)$to_data_frame(),
data.frame(rc = as.numeric(5:36), df_exp)
)

# check all parallel strategies work
for(choice in c("auto", "COLUMNS", "None", "rowGroups")) {
for (choice in c("auto", "COLUMNS", "None", "rowGroups")) {
expect_identical(
pl$read_parquet(tmpf, parallel = choice)$to_data_frame(),
df_exp
Expand All @@ -39,6 +37,4 @@ test_that("scan read parquet", {
expect_identical(ctx$BadArgument, "parallel")
ctx = pl$read_parquet(tmpf, parallel = 42) |> get_err_ctx()
expect_identical(ctx$NotAChoice, "input is not a character vector")


})

0 comments on commit bf4b410

Please sign in to comment.