act-now-coalition / covid-data-model

Data backend providing computed data for the graphs displayed at https://covidactnow.org
https://covidactnow.org/
MIT License
149 stars 57 forks source link

Fix off-by-one issue causing community levels to go blank #1376

Closed smcclure17 closed 1 year ago

smcclure17 commented 1 year ago

Forward-filling the metrics by MAX_METRIC_LOOKBACK_DAYS - 2 (13 days) knocked the community-level-calculation logic out of sync with the top-level metric forward-filling.

This caused a situation where the community-level logic determined that the hospital metrics were missing (and set the community level to None), but the metrics were still displayed/weren't filtered out by the rest of the API

Full snapshot building with these changes: https://github.com/act-now-coalition/covid-data-model/actions/runs/5084966505