You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/11 21:23:22 UTC

[GitHub] [arrow] nealrichardson commented on a change in pull request #9167: ARROW-11136: [R] Bindings for is.nan

nealrichardson commented on a change in pull request #9167:
URL: https://github.com/apache/arrow/pull/9167#discussion_r555347689



##########
File path: r/tests/testthat/test-dataset.R
##########
@@ -417,6 +417,17 @@ test_that("filter() with is.na()", {
   )
 })
 
+test_that("filter() with is.na()", {
+  ds <- open_dataset(dataset_dir, partitioning = schema(part = uint8()))
+  expect_equivalent(
+    ds %>%
+      select(part, dbl) %>%
+      filter(!is.nan(dbl), part == 1) %>%

Review comment:
       I'm not sure this is a great test because the NaN you added looks like it is in `part == 2`

##########
File path: r/tests/testthat/test-dataset.R
##########
@@ -417,6 +417,17 @@ test_that("filter() with is.na()", {
   )
 })
 
+test_that("filter() with is.na()", {

Review comment:
       ```suggestion
   test_that("filter() with is.nan()", {
   ```

##########
File path: r/R/expression.R
##########
@@ -111,7 +111,8 @@ cast_array_expression <- function(x, to_type, safe = TRUE, ...) {
 
 .unary_function_map <- list(
   "!" = "invert",
-  "is.na" = "is_null"
+  "is.na" = "is_null",
+  "is.nan" = "is_nan"

Review comment:
       It's beautiful that this is the only change needed to support this in the dplyr code.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org