Skip to content

Commit

Permalink
fix: the latest nanoarrow supports utf8view type
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi committed Oct 16, 2024
1 parent e3c1343 commit e5df02d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Suggests:
jsonlite,
knitr,
lubridate,
nanoarrow (>= 0.4.0),
nanoarrow (>= 0.6.0),
nycflights13,
patrick,
pillar,
Expand Down
16 changes: 6 additions & 10 deletions tests/testthat/test-pkg-nanoarrow.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_that("as_nanoarrow_array_stream() works for DataFrame", {
skip_if_not_installed("nanoarrow")
skip_if_not_installed("nanoarrow", minimum_version = "0.6.0")

df = pl$DataFrame(a = 1L, b = "two")
stream = nanoarrow::as_nanoarrow_array_stream(df)
Expand All @@ -9,18 +9,16 @@ test_that("as_nanoarrow_array_stream() works for DataFrame", {
data.frame(a = 1L, b = "two")
)

# nanoarrow does not support the string view type yet
# https://github.com/apache/arrow-nanoarrow/pull/367
expect_grepl_error(
expect_identical(
nanoarrow::as_nanoarrow_array_stream(df, compat_level = TRUE) |>
as.data.frame(),
"Unknown format: 'vu'"
data.frame(a = 1L, b = "two")
)
})


test_that("as_nanoarrow_array_stream() works for Series", {
skip_if_not_installed("nanoarrow")
skip_if_not_installed("nanoarrow", minimum_version = "0.6.0")

s = as_polars_series(letters[1:3])
stream = nanoarrow::as_nanoarrow_array_stream(s)
Expand All @@ -30,12 +28,10 @@ test_that("as_nanoarrow_array_stream() works for Series", {
letters[1:3]
)

# nanoarrow does not support the string view type yet
# https://github.com/apache/arrow-nanoarrow/pull/367
expect_grepl_error(
expect_identical(
nanoarrow::as_nanoarrow_array_stream(s, compat_level = TRUE) |>
as.vector(),
"Unknown format: 'vu'"
letters[1:3]
)
})

Expand Down

0 comments on commit e5df02d

Please sign in to comment.