Skip to content

Commit

Permalink
Merge pull request #697 from ccao-data/remove-infinity-from-mydec-exe…
Browse files Browse the repository at this point in the history
…mption-values

Remove `-Inf` from `sales.mydec`
  • Loading branch information
wrridgeway authored Jan 6, 2025
2 parents d7be7db + b4d1f6f commit 9becd94
Showing 1 changed file with 5 additions and 0 deletions.
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))) %>%
distinct(
document_number,
line_7_property_advertised,
Expand Down

0 comments on commit 9becd94

Please sign in to comment.