electricitymaps-contrib
electricitymaps-contrib copied to clipboard
refactor: remove arrow from CO parser
Issue #6135
Description
Removes arrow dependency from CO parser. Note: It seems the 'fecha' datapoint sometimes is missing the full millisecond precision, so there is a check to add a trailing zero if that is the case
Preview
Double check
- [X] I have tested my parser changes locally with
poetry run test_parser "zone_key"
- [X] I have run
pnpx prettier@2 --write .
andpoetry run format
in the top level directory to format my changes.
@VIKTORVAV99 I researched the difference between .replace() and astimezone() for changing timezones and indeed it looks like astimezone() is the preferred method. I used replace() in my refactor for both CA_AB and CA_BC - do you want me to go back and update those to astimezone(), or are you ok with those as they are?
@VIKTORVAV99 I researched the difference between .replace() and astimezone() for changing timezones and indeed it looks like astimezone() is the preferred method. I used replace() in my refactor for both CA_AB and CA_BC - do you want me to go back and update those to astimezone(), or are you ok with those as they are?
In general I think where we used .replace()
in arrow we should still use replace and where arrow used .to()
we should use .astimezone()
instead.
The absolut best way to ensure there is no missmatch between the two would be to add snapshot tests before modifying them and then making sure the date times don't change (more than the tz info).
Sorry for taking so long to review this but I have been unable to get the parser working locally, it seems to be unrelated to your changes but I don't really want to merge this without a side by side comparison of the data since we don't have any tests for this parser.