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

Backwards compatibility issue #17

Open
christopher-hardy opened this issue Aug 11, 2020 · 2 comments
Open

Backwards compatibility issue #17

christopher-hardy opened this issue Aug 11, 2020 · 2 comments

Comments

@christopher-hardy
Copy link

christopher-hardy commented Aug 11, 2020

Hi,

Thanks for creating this package it has been a great help.

I was using v0.3.3 and had saved the object, then upgraded to v0.3.5. When I read the v0.3.3 object into a v0.3.5 environment I get the following error: Error in missing_arg(default) : could not find function "missing_arg". If I re-create the same hash using v0.3.5 everything works OK.

Reproducible Example:

# install v0.3.3 & v0.3.5
devtools::install_version(
  "collections", 
  version = "0.3.3",
  lib = "~/v3.3"
)
devtools::install_version(
  "collections", 
  version = "0.3.5",
  lib = "~/v3.5"
)

# create and save hash in v0.3.3
detach("package:collections", unload = TRUE)
library("collections", lib = "~/v3.3")
h3.3 <- dict(
  items = list(1, 2, 3),
  keys = list("A", "B", "C")
)
saveRDS(h3.3, file = "~/v3.3.rds")

# load v0.3.5
detach("package:collections", unload = TRUE)
library("collections", lib = "~/v3.5")
h3.3 <- readRDS(file = "~/v3.3.rds")
h3.3$get("A")
# Error in missing_arg(default) : could not find function "missing_arg"

# create and test new hash in v0.3.5
h3.5 <- dict(
  items = list(1, 2, 3),
  keys = list("A", "B", "C")
)
h3.5$get("A")
@randy3k
Copy link
Owner

randy3k commented Aug 11, 2020

Unfortunately, the dict object is not meant to be portable in such way. It is very easy to break things. We might need to encapsulate the whole closure in order to make it portable.

Thank you for raising the issue though.

@randy3k
Copy link
Owner

randy3k commented Aug 11, 2020

Actually it isn't limited to this package. A lot of other packages are subjected to break if an object is serialised and deserialised under different versions.

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