Skip to content

[R] Test failure with dev waldo #35131

Closed

Description

@hadley

Describe the bug, including details regarding any error messages, version, and platform.

The arrow R package is failing with dev waldo with errors like this:

── Failure ('test-compute-sort.R:111:3'): sort(vector), sort(Array), sort(ChunkedArray) give equivalent results on floats ──
`object` (`actual`) not equal to `expected` (`expected`).

actual[6:10] vs expected[6:10]
  -0
  -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
  -Inf
- NaN
+ NA
- NA
+ NaN

The root cause is that waldo now correctly distinguishes NaN and NA_real_.

Component(s)

R

Activity

  1. changed the title [-]Test failure with dev waldo[/-] [+][R] Test failure with dev waldo[/+] on Apr 14, 2023
  2. paleolimbot commented on Apr 14, 2023

    @paleolimbot
    Member

    Some more failures with pak::pak("r-lib/waldo"). Seems mostly related to sorting (my guess being that Arrow sorts NA and NaN in reverse).

    Failure ('test-compute-sort.R:111'): sort(vector), sort(Array), sort(ChunkedArray) give equivalent results on floats
    `object` (`actual`) not equal to `expected` (`expected`).
    
    actual[6:10] vs expected[6:10]
      -0
      -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
      -Inf
    - NaN
    + NA
    - NA
    + NaN
    Backtrace:
     1. arrow:::compare_expression(...)
          at test-compute-sort.R:111:2
     2. arrow:::expect_as_vector(via_array, expected, ignore_attr, ...)
          at tests/testthat/helper-expectation.R:190:4
     3. arrow:::expect_equal(as.vector(x), y, ...)
          at tests/testthat/helper-expectation.R:19:2
     4. testthat::expect_equal(...)
          at tests/testthat/helper-expectation.R:42:4
    
    Failure ('test-compute-sort.R:111'): sort(vector), sort(Array), sort(ChunkedArray) give equivalent results on floats
    `object` (`actual`) not equal to `expected` (`expected`).
    
    actual[6:10] vs expected[6:10]
      -0
      -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
      -Inf
    - NaN
    + NA
    - NA
    + NaN
    Backtrace:
     1. arrow:::compare_expression(...)
          at test-compute-sort.R:111:2
     2. arrow:::expect_as_vector(...)
          at tests/testthat/helper-expectation.R:203:4
     3. arrow:::expect_equal(as.vector(x), y, ...)
          at tests/testthat/helper-expectation.R:19:2
     4. testthat::expect_equal(...)
          at tests/testthat/helper-expectation.R:42:4
    
    Failure ('test-compute-sort.R:115'): sort(vector), sort(Array), sort(ChunkedArray) give equivalent results on floats
    `object` (`actual`) not equal to `expected` (`expected`).
    
    actual[6:10] vs expected[6:10]
      3
      179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
      Inf
    - NaN
    + NA
    - NA
    + NaN
    Backtrace:
     1. arrow:::compare_expression(...)
          at test-compute-sort.R:115:2
     2. arrow:::expect_as_vector(via_array, expected, ignore_attr, ...)
          at tests/testthat/helper-expectation.R:190:4
     3. arrow:::expect_equal(as.vector(x), y, ...)
          at tests/testthat/helper-expectation.R:19:2
     4. testthat::expect_equal(...)
          at tests/testthat/helper-expectation.R:42:4
    
    Failure ('test-compute-sort.R:115'): sort(vector), sort(Array), sort(ChunkedArray) give equivalent results on floats
    `object` (`actual`) not equal to `expected` (`expected`).
    
    actual[6:10] vs expected[6:10]
      3
      179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
      Inf
    - NaN
    + NA
    - NA
    + NaN
    Backtrace:
     1. arrow:::compare_expression(...)
          at test-compute-sort.R:115:2
     2. arrow:::expect_as_vector(...)
          at tests/testthat/helper-expectation.R:203:4
     3. arrow:::expect_equal(as.vector(x), y, ...)
          at tests/testthat/helper-expectation.R:19:2
     4. testthat::expect_equal(...)
          at tests/testthat/helper-expectation.R:42:4
    
    Failure ('test-compute-sort.R:123'): sort(vector), sort(Array), sort(ChunkedArray) give equivalent results on floats
    `object` (`actual`) not equal to `expected` (`expected`).
    
    actual[1:5] vs expected[1:5]
    - NaN
    + NA
    - NA
    + NaN
      Inf
      179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
      3
    Backtrace:
     1. arrow:::compare_expression(...)
          at test-compute-sort.R:123:2
     2. arrow:::expect_as_vector(via_array, expected, ignore_attr, ...)
          at tests/testthat/helper-expectation.R:190:4
     3. arrow:::expect_equal(as.vector(x), y, ...)
          at tests/testthat/helper-expectation.R:19:2
     4. testthat::expect_equal(...)
          at tests/testthat/helper-expectation.R:42:4
    
    Failure ('test-compute-sort.R:123'): sort(vector), sort(Array), sort(ChunkedArray) give equivalent results on floats
    `object` (`actual`) not equal to `expected` (`expected`).
    
    actual[1:5] vs expected[1:5]
    - NaN
    + NA
    - NA
    + NaN
      Inf
      179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
      3
    Backtrace:
     1. arrow:::compare_expression(...)
          at test-compute-sort.R:123:2
     2. arrow:::expect_as_vector(...)
          at tests/testthat/helper-expectation.R:203:4
     3. arrow:::expect_equal(as.vector(x), y, ...)
          at tests/testthat/helper-expectation.R:19:2
     4. testthat::expect_equal(...)
          at tests/testthat/helper-expectation.R:42:4
    
    Failure ('test-compute-sort.R:131'): sort(vector), sort(Array), sort(ChunkedArray) give equivalent results on floats
    `object` (`actual`) not equal to `expected` (`expected`).
    
    actual[1:5] vs expected[1:5]
    - NaN
    + NA
    - NA
    + NaN
      -Inf
      -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
      -0
    Backtrace:
     1. arrow:::compare_expression(...)
          at test-compute-sort.R:131:2
     2. arrow:::expect_as_vector(via_array, expected, ignore_attr, ...)
          at tests/testthat/helper-expectation.R:190:4
     3. arrow:::expect_equal(as.vector(x), y, ...)
          at tests/testthat/helper-expectation.R:19:2
     4. testthat::expect_equal(...)
          at tests/testthat/helper-expectation.R:42:4
    
    Failure ('test-compute-sort.R:131'): sort(vector), sort(Array), sort(ChunkedArray) give equivalent results on floats
    `object` (`actual`) not equal to `expected` (`expected`).
    
    actual[1:5] vs expected[1:5]
    - NaN
    + NA
    - NA
    + NaN
      -Inf
      -179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368
      -0
    Backtrace:
     1. arrow:::compare_expression(...)
          at test-compute-sort.R:131:2
     2. arrow:::expect_as_vector(...)
          at tests/testthat/helper-expectation.R:203:4
     3. arrow:::expect_equal(as.vector(x), y, ...)
          at tests/testthat/helper-expectation.R:19:2
     4. testthat::expect_equal(...)
          at tests/testthat/helper-expectation.R:42:4
    
    Skip ('test-dplyr-funcs-conditional.R:147'): if_else and ifelse
    Reason: ARROW-13364
    
    Failure ('test-dplyr-funcs-conditional.R:380'): coalesce()
    `object` (`actual`) not equal to `expected` (`expected`).
    
    actual vs expected
                     cw cwx
      actual[1, ]    NA  NA
    - actual[2, ]   NaN NaN
    + expected[2, ]  NA  NA
      actual[3, ]    NA 3.3
    
      `actual$cw`: NA NaN NA
    `expected$cw`: NA  NA NA
    
      `actual$cwx`: NA NaN 3
    `expected$cwx`: NA  NA 3
    Backtrace:
     1. arrow:::compare_dplyr_binding(...)
          at test-dplyr-funcs-conditional.R:380:2
     2. arrow:::expect_equal(via_table, expected, ...)
          at tests/testthat/helper-expectation.R:101:2
     3. testthat::expect_equal(...)
          at tests/testthat/helper-expectation.R:42:4
    
    Failure ('test-dplyr-funcs-conditional.R:394'): coalesce()
    df %>% Table$create() %>% mutate(cwx = coalesce(w, x)) %>% collect() (`actual`) not identical to df %>% mutate(cwx = coalesce(w, x)) (`expected`).
    
    actual vs expected
                    cwx
      actual[1, ]    NA
    - actual[2, ]   NaN
    + expected[2, ]  NA
      actual[3, ]   3.3
    
      `actual$cwx`: NA NaN 3
    `expected$cwx`: NA  NA 3
    
    Failure ('test-dplyr-funcs-conditional.R:398'): coalesce()
    df %>% Table$create() %>% transmute(cw = coalesce(w)) %>% collect() (`actual`) not identical to df %>% transmute(cw = coalesce(w)) (`expected`).
    
    actual vs expected
                     cw
      actual[1, ]    NA
    - actual[2, ]   NaN
    + expected[2, ]  NA
      actual[3, ]    NA
    
      `actual$cw`: NA NaN NA
    `expected$cw`: NA  NA NA
    
    Failure ('test-dplyr-funcs-conditional.R:402'): coalesce()
    df %>% Table$create() %>% transmute(cn = coalesce(NaN)) %>% collect() (`actual`) not identical to df %>% transmute(cn = coalesce(NaN)) (`expected`).
    
    actual vs expected
                     cn
    - actual[1, ]   NaN
    + expected[1, ]  NA
    - actual[2, ]   NaN
    + expected[2, ]  NA
    - actual[3, ]   NaN
    + expected[3, ]  NA
    
      `actual$cn`: NaN NaN NaN
    `expected$cn`:  NA  NA  NA
    
    Failure ('test-dplyr-funcs-conditional.R:421'): coalesce()
    `object` (`actual`) not equal to `expected` (`expected`).
    
    actual vs expected
                     c3  c6
    - actual[1, ]   NaN NaN
    + expected[1, ]  NA  NA
    - actual[2, ]   NaN 2.2
    + expected[2, ]  NA 2.2
    - actual[3, ]   NaN 3.3
    + expected[3, ]  NA 3.3
    
      `actual$c3`: NaN NaN NaN
    `expected$c3`:  NA  NA  NA
    
      `actual$c6`: NaN 2 3
    `expected$c6`:  NA 2 3
    Backtrace:
     1. arrow:::compare_dplyr_binding(...)
          at test-dplyr-funcs-conditional.R:421:2
     2. arrow:::expect_equal(via_table, expected, ...)
          at tests/testthat/helper-expectation.R:101:2
     3. testthat::expect_equal(...)
          at tests/testthat/helper-expectation.R:42:4
    
  3. added a commit that references this issue on Apr 26, 2023
  4. added this to the 13.0.0 milestone on Apr 26, 2023
  5. added a commit that references this issue on May 3, 2023
  6. added a commit that references this issue on May 11, 2023
  7. added a commit that references this issue on May 15, 2023
  8. modified the milestones: 13.0.0, 12.0.1 on May 30, 2023
  9. added a commit that references this issue on May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions