Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Fixes issue with purchase-model when date is a string #406

Closed
wants to merge 2 commits into from

Conversation

madsnedergaard
Copy link
Member

@madsnedergaard madsnedergaard commented May 20, 2020

Currently the calculation of emissions is failing (silently) when date is a string and not a date object. This PR fixes that by allowing both.

The error: Error while computing footprint: datetime.getFullYear is not a function

I also re-arranged the tests a bit to group all the CPI related tests.

@madsnedergaard madsnedergaard added bug Something isn't working carbon model labels May 20, 2020
@madsnedergaard madsnedergaard self-assigned this May 20, 2020
@corradio
Copy link
Member

For reference: we discussed about not changing the models (thus keeping Date types), and however make sure that strings are correctly converted in our internal systems.

@madsnedergaard
Copy link
Member Author

madsnedergaard commented May 20, 2020

As @corradio said, this should be fixed at usage instead.

@madsnedergaard madsnedergaard deleted the mn/fix-purchase-cpi-dates branch May 20, 2020 12:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working carbon model
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants