Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[R] Test failure with dev waldo #35131

Closed
hadley opened this issue Apr 14, 2023 · 1 comment · Fixed by #35308
Closed

[R] Test failure with dev waldo #35131

hadley opened this issue Apr 14, 2023 · 1 comment · Fixed by #35308
Assignees
Milestone

Comments

@hadley
Copy link
Contributor

hadley commented Apr 14, 2023

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

@paleolimbot paleolimbot changed the title Test failure with dev waldo [R] Test failure with dev waldo Apr 14, 2023
@hadley hadley mentioned this issue Apr 14, 2023
23 tasks
@paleolimbot
Copy link
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

thisisnic added a commit that referenced this issue Apr 26, 2023
This PR fixes the tests failing due to the dev version of the waldo package being more strict comparing NaN and NA_real_ values.  (n.b. our CI doesn't yet use the dev version of waldo, so this PR should be tested locally to verify tests pass).
* Closes: #35131

Authored-by: Nic Crane <thisisnic@gmail.com>
Signed-off-by: Nic Crane <thisisnic@gmail.com>
@thisisnic thisisnic added this to the 13.0.0 milestone Apr 26, 2023
thisisnic added a commit to thisisnic/arrow that referenced this issue May 3, 2023
This PR fixes the tests failing due to the dev version of the waldo package being more strict comparing NaN and NA_real_ values.  (n.b. our CI doesn't yet use the dev version of waldo, so this PR should be tested locally to verify tests pass).
* Closes: apache#35131

Authored-by: Nic Crane <thisisnic@gmail.com>
Signed-off-by: Nic Crane <thisisnic@gmail.com>
liujiacheng777 pushed a commit to LoongArch-Python/arrow that referenced this issue May 11, 2023
This PR fixes the tests failing due to the dev version of the waldo package being more strict comparing NaN and NA_real_ values.  (n.b. our CI doesn't yet use the dev version of waldo, so this PR should be tested locally to verify tests pass).
* Closes: apache#35131

Authored-by: Nic Crane <thisisnic@gmail.com>
Signed-off-by: Nic Crane <thisisnic@gmail.com>
ArgusLi pushed a commit to Bit-Quill/arrow that referenced this issue May 15, 2023
This PR fixes the tests failing due to the dev version of the waldo package being more strict comparing NaN and NA_real_ values.  (n.b. our CI doesn't yet use the dev version of waldo, so this PR should be tested locally to verify tests pass).
* Closes: apache#35131

Authored-by: Nic Crane <thisisnic@gmail.com>
Signed-off-by: Nic Crane <thisisnic@gmail.com>
rtpsw pushed a commit to rtpsw/arrow that referenced this issue May 16, 2023
This PR fixes the tests failing due to the dev version of the waldo package being more strict comparing NaN and NA_real_ values.  (n.b. our CI doesn't yet use the dev version of waldo, so this PR should be tested locally to verify tests pass).
* Closes: apache#35131

Authored-by: Nic Crane <thisisnic@gmail.com>
Signed-off-by: Nic Crane <thisisnic@gmail.com>
@raulcd raulcd modified the milestones: 13.0.0, 12.0.1 May 30, 2023
raulcd pushed a commit that referenced this issue May 30, 2023
This PR fixes the tests failing due to the dev version of the waldo package being more strict comparing NaN and NA_real_ values.  (n.b. our CI doesn't yet use the dev version of waldo, so this PR should be tested locally to verify tests pass).
* Closes: #35131

Authored-by: Nic Crane <thisisnic@gmail.com>
Signed-off-by: Nic Crane <thisisnic@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants