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

Upload_values_fix #48

Merged
merged 8 commits into from
Mar 18, 2024
Merged

Upload_values_fix #48

merged 8 commits into from
Mar 18, 2024

Conversation

randrescastaneda
Copy link
Owner

@randrescastaneda randrescastaneda commented Feb 29, 2024

This PR contains the following:

  1. Fix bug in update_values() and updates_NAs() where they were not updating multiple variables.
  2. Add different syntax if the input tables are data.table or other.
  3. Update some tests (These two functions are still under-tested) @RossanaTat, could you please add some tests, especially for edge cases? Thanks.

image

vary_na = !missing_cases(get(y.var)))

varx_na = !missing_cases(mget(x.var)),
vary_na = !missing_cases(mget(y.var)))

# let `use_util_reportvar` reflect updates
# FALSE => is NA and not 2, 4 => NA updated
Copy link
Collaborator

Choose a reason for hiding this comment

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

@randrescastaneda , here we replace NAs in x with values in y. This should not happen in update_values() only in update_NAs()


# Updating values in x2$x with values from y2$x
res <- update_values(dt,
var = "x",
reportvar = ".joyn")
# check not updated values
which(is.na(res$x.x) & res$.joyn != 2) |>
Copy link
Collaborator

Choose a reason for hiding this comment

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

No values in x should be updated here for dt. Because every row in x either has an NA or the corresponding row in y has an NA.

@zander-prinsloo zander-prinsloo merged commit b1b84d9 into DEV Mar 18, 2024
7 checks passed
@randrescastaneda randrescastaneda deleted the upload_values_fix branch March 28, 2024 13:46
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.

2 participants