Skip to content

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

Merged
jennybc merged 4 commits into
r-lib:mainfrom
laurabrianna:bump-default-version
Aug 15, 2024
Merged

Bump default serialization version in use_data() to 3#2044
jennybc merged 4 commits into
r-lib:mainfrom
laurabrianna:bump-default-version

Conversation

@laurabrianna

Copy link
Copy Markdown
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

@jennybc jennybc left a comment

Copy link
Copy Markdown
Member

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

jennybc commented Aug 15, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor Author

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

@jennybc

jennybc commented Aug 15, 2024

Copy link
Copy Markdown
Member

Thanks!

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