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

Bump default serialization version in use_data() to 3 #2044

Merged
merged 4 commits into from
Aug 15, 2024

Conversation

laurabrianna
Copy link
Contributor

Fixes #1966 - The grand sum of this update is one character (plus a news bullet) Note that this change did not break anything in any test (should a test be added?)

@jennybc jennybc changed the title Fixes #1966 - bumped default serialization version in use_data() to 3 Bump default serialization version in use_data() to 3 Aug 15, 2024
Copy link
Member

@jennybc jennybc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good!

Can you take a look at the docs for the version argument? They state that the default is 2, which is not correct anymore. So this needs a refresh.

#' @param version The serialization format version to use. The default, 2, was
#'   the default format from R 1.4.0 to 3.5.3. Version 3 became the default from
#'   R 3.6.0 and can only be read by R versions 3.5.0 and higher.

@jennybc
Copy link
Member

jennybc commented Aug 15, 2024

I think we do have a test that claims to probe default behaviour but it's clearly not working! Because it actually provides the version argument.

Would you also like to fix and update this test?

test_that("use_data() writes version 2 by default", {
  create_local_package()

  x <- letters
  use_data(x, internal = TRUE, version = 2, compress = FALSE)
  expect_identical(
    rawToChar(readBin(proj_path("R", "sysdata.rda"), n = 4, what = "raw")),
    "RDX2"
  )
})

@laurabrianna
Copy link
Contributor Author

Hi Jenny thanks for all your help (and patience!) I incorporated both your notes above!

@jennybc
Copy link
Member

jennybc commented Aug 15, 2024

Thanks!

@jennybc jennybc merged commit 4ce704b into r-lib:main Aug 15, 2024
12 checks passed
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

Successfully merging this pull request may close these issues.

Bump the default version argument in use_data() to 3
2 participants