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

upcoming tibble breaks units #225

Closed
edzer opened this issue Feb 29, 2020 · 4 comments
Closed

upcoming tibble breaks units #225

edzer opened this issue Feb 29, 2020 · 4 comments

Comments

@edzer
Copy link
Member

edzer commented Feb 29, 2020

Dear Edzer Pebesma,

This is an automated email to let you know that:

  • A new version of tibble is ready to go to CRAN. tibble is
    currently at version 2.99.99.9014 and will become 3.0.0 upon release.

  • units uses tibble and has problems with the new version.

  • We plan to submit tibble to CRAN on Mar 18.

Major update, using vctrs internally.

I need your help to keep units and tibble working together smoothly.
In the next days, can you please:

  1. Read about the changes to tibble at
    https://github.com/tidyverse/tibble/blob/master/NEWS.md.
    This page includes a list of breaking changes, the reasoning behind
    them, and to how to update your code.

  2. Carefully inspect the failing checks listed at the bottom of this email.

  3. For each failing check, either update your package, or tell me
    that I have a bug. If you have made changes to your package, please
    submit an update to CRAN before Mar 18.

If you have discovered a bug in tibble, please file an issue (ideally
with a small reprex that illustrates the problem) at
https://github.com/tidyverse/tibble/issues. If you're not sure whether
or not you've found a bug, please file an issue at
https://github.com/tidyverse/tibble/issues for discussion. Breaking
changes that are not listed qualify as bugs.

Please respond to this message if you have any questions.

Thanks,

Kirill

== CHECK RESULTS ========================================

  • checking tests ...
     ERROR
    Running the tests in ‘tests/testthat.R’ failed.
    Last 13 lines of output:
      All columns in a tibble must be vectors:
      * Column `m` is mixed_units
      Backtrace:
       1. base::print(tibble::tibble(m))
       2. tibble::tibble(m)
       3. tibble:::tibble_quos(xs[!is_null], .rows, .name_repair)
       4. tibble:::check_valid_col(res, col_names[[j]], j)
       5. tibble:::check_valid_cols(list2(`:=`(!!name, x)))
    
      ══ testthat results
    

══════════════════════════════════════════════════════════════
[ OK: 416 | SKIPPED: 6 | WARNINGS: 13 | FAILED: 1 ]
1. Error: mixed units work (@test_mixed.R#46)

  Error: testthat unit tests failed
  Execution halted
```
@Enchufa2
Copy link
Member

Enchufa2 commented Mar 1, 2020

According to the news,

List classes are no longer automatically treated as vectors. Symptoms:

  • Error: All columns in a tibble must be vectors
  • Error: Expected a vector, not a ... object

If you implement a class that wraps a list as S3 vector, you need to include "list" in the class:

structure(x, class = c("your_s3_class", "list"))

So adding "list" to "mixed_units" should be enough.

@Enchufa2
Copy link
Member

Simple fix. Tested successfully against tibble 2.99.99.9014. NEWS and version updated, ready for CRAN submission.

@edzer
Copy link
Member Author

edzer commented Mar 11, 2020

Thank you so much!

@edzer
Copy link
Member Author

edzer commented Mar 16, 2020

Great, on its way to CRAN now.

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