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

df_proxy() should unconditionally clone #1837

Closed
DavisVaughan opened this issue May 8, 2023 · 0 comments · Fixed by #1838
Closed

df_proxy() should unconditionally clone #1837

DavisVaughan opened this issue May 8, 2023 · 0 comments · Fixed by #1838

Comments

@DavisVaughan
Copy link
Member

Otherwise we can end up modifying a freshly created C object in place that we didn't mean to, like in tidyverse/dplyr#6844

library(vctrs)

x <- package_version(c("4.0", "2.0.0.0.0.0.0.8"))
y <- package_version(c("1.0", "3.0" ,"4.0"))

# fine
vec_set_difference(x, y)
#> [1] '2.0.0.0.0.0.0.8'

x <- tibble::tibble(a = x)
y <- tibble::tibble(a = y)

# uh oh
vec_set_difference(x, y)
#> # A tibble: 1 × 1
#>   a$...1 $...2 $...3 $...4 $...5 $...6 $...7 $...8
#>    <int> <int> <int> <int> <int> <int> <int> <int>
#> 1      2     0     0     0     0     0     0     8

Created on 2023-05-08 with reprex v2.0.2.9000

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 a pull request may close this issue.

1 participant