You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I misunderstand the role of the ids parameter, but records with different primary keys should be treated separately.
Instead, it seems that diff_data detects changes, even if the key is forced.
df_ref<-tibble::tribble(
~a, ~b, ~key,
1, "test1", "key_001", # only in ref2, "test2", "key_002",
3, "test3", "key_003",
)
df_current<-tibble::tribble(
~a, ~b, ~key,
2, "TEST2", "key_002", # non-key change3, "test3", "KEY_003", # key change4, "test4", "key_004", # only in current
)
diff_structure<-daff::diff_data(
data_ref=df_ref,
data=df_current,
ids="key",
ordered=FALSE
)
diff_structure#> Daff Comparison: 'df_ref' vs. 'df_current' #> a b key #> --- 1 test1 key_001 #> -> 2 test2->TEST2 key_002 #> -> 3 test3 key_003->KEY_003#> +++ 4 test4 key_004
I would have expected something like:
#> --- 3 test3 key_003#> +++ 3 test3 KEY_003
Even if I compare without the ID, I get the same result:
I am facing the same issue. Even after I specify primary key using ids, the changes with respect to Primary keys provide wrong output as mentioned in example by @lgaborini
Maybe I misunderstand the role of the
ids
parameter, but records with different primary keys should be treated separately.Instead, it seems that
diff_data
detects changes, even if the key is forced.I would have expected something like:
Even if I compare without the ID, I get the same result:
Created on 2021-04-14 by the reprex package (v2.0.0)
(I am using the latest daff on CRAN, 0.3.5)
Thanks!
The text was updated successfully, but these errors were encountered: