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

Remove -Inf from sales.mydec #697

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions etl/scripts-ccao-data-warehouse-us-east-1/sale/sale-mydec.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ map(files, clean_up) %>%
# Because MyDec variables can be different across duplicate sales doc #s,
# we'll take the max values
mutate(across(all_of(mydec_vars), ~ max(.x, na.rm = TRUE))) %>%
# The max of an empty set is `-Inf`, but we want it to be null instead
# since `-Inf` is not semantically meaningful in our output data.
# Cast all `-Inf`s to null in case all values of a MyDec field were null
# across all dupes ahead of the `max()` call above
mutate(across(all_of(mydec_vars), ~ na_if(.x, -Inf))) %>%
wrridgeway marked this conversation as resolved.
Show resolved Hide resolved
distinct(
document_number,
line_7_property_advertised,
Expand Down
Loading