Skip to content

is.atomic(NULL) now returns FALSE on R-devel #5447

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

Closed
yutannihilation opened this issue Oct 1, 2023 · 2 comments
Closed

is.atomic(NULL) now returns FALSE on R-devel #5447

yutannihilation opened this issue Oct 1, 2023 · 2 comments

Comments

@yutannihilation
Copy link
Member

I found the CI with R-devel runner started to fail with a real error, not the timeout. Actually, the CRAN check now fails with the same error:

     ══ Failed tests ════════════════════════════════════════════════════════════════
     ── Failure ('test-aes-calculated.R:50:3'): make_labels() deprases mappings properly ──
     make_labels(aes(x = NULL)) (`actual`) not identical to list(x = "x") (`expected`).
    
     `actual$x`: "NULL"
     `expected$x`: "x"
     ── Error ('test-aes.R:29:3'): aes_q() & aes_string() preserve explicit NULLs ───
     Error in `FUN(X[[i]], ...)`: Aesthetic must be a one-sided formula, call, name, or constant.
     Backtrace:
     ▆
     1. ├─base::suppressWarnings(expect_equal(aes_q(NULL), aes(NULL))) at test-aes.R:29:2
     2. │ └─base::withCallingHandlers(...)
     3. ├─testthat::expect_equal(aes_q(NULL), aes(NULL))
     4. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
     5. │ └─rlang::eval_bare(expr, quo_get_env(quo))
     6. └─ggplot2::aes_q(NULL)
     7. └─base::lapply(mapping, as_quosure_aes)
     8. └─ggplot2 (local) FUN(X[[i]], ...)
     9. └─cli::cli_abort("Aesthetic must be a one-sided formula, call, name, or constant.")
     10. └─rlang::abort(...)
     ── Failure ('test-aes.R:102:3'): labelling doesn't cause error if aesthetic is NULL ──
     p$labels$x (`actual`) not identical to "x" (`expected`).
    
     `actual`: "NULL"
     `expected`: "x" 

I'm not sure, but I'm suspecting this breaking change NEWS is somehow related.

is.atomic(NULL) now returns FALSE, as NULL is not an atomic vector. Strict back compatibility would replace is.atomic(foo) by (is.null(foo) || is.atomic(foo)) but should happen sparingly only.

This seems commit:

wch/r-source@c97dbd1

@teunbrand
Copy link
Collaborator

Thanks for posting this! Thomas was informed that this would change soon in R-devel, so that we can release a hotfix to patch this (see #5437 (comment)). Now that it is implemented, we can start testing solutions.

@yutannihilation
Copy link
Member Author

Oh, sorry, this was the very reason for the patch release! Sorry, I overlooked the comment (and the announcement on the R-devel mailing list). Then, I'm closing this issue in favor of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants