Closed jdhoffa closed 1 month ago
Attention: Patch coverage is 0%
with 1 line
in your changes missing coverage. Please review.
Project coverage is 18.82%. Comparing base (
0b3d197
) to head (0540029
).
Files | Patch % | Lines |
---|---|---|
R/prepare_financial_data.R | 0.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
current_shares_outstanding_all_classes
–a value that is synonymous with theshares_all_classes
value– is used downstream to calculateownership_weight
. This value is unusable by theownership_weight
calculation if it is 0, as it will cause divide by 0 problems and yield Inf results: (https://github.com/RMI-PACTA/pacta.portfolio.allocate/blob/4c96adb9856788d97293e41c0cd68b8951c3c56b/R/calculate_ownership_weight.R#L5).There is already a filter in
prepare_financial_data
to remove this case, however it filters a wrong (but similar) column.An edge case was found by @Antoine-Lalechere in which ADR holdings with no similar EQ holdings pass through and yield a 0 value for
shares_all_classes
, which identified this bug.This PR adjusts the filter to ensure that the correct value is filtered and usable in the downstream analysis.
See the reprex below for more information:
Created on 2024-07-17 with reprex v2.1.1