electricitymaps / bloom-contrib

Making carbon footprint data available to everyone.
https://www.bloomclimate.com
MIT License
434 stars 104 forks source link

Purchase model is not checking for identifier #465

Closed madsnedergaard closed 3 years ago

madsnedergaard commented 3 years ago

Description

The purchase canModelRun() implementation is not checking for identifier and therefore calculations fail a lot of times were it shouldn't have been running.

To reproduce

Steps to reproduce:

  1. Check logs here: https://console.cloud.google.com/run/detail/europe-west1/lh-footprint-updater/logs?project=tmrowapp

Expected behaviour

canModelRun should return false if a purchase activity any identifier is null.

Pseudo code fix:

lineItems.every(item => item.identifier !== null)
skovhus commented 3 years ago

Anything that needs to be done here, except for merging? :)

madsnedergaard commented 3 years ago

CI is failing due to issue with dates in energinet test.. Will look into it now

madsnedergaard commented 3 years ago

Open until contrib is bumped!

madsnedergaard commented 3 years ago

Aaand done!