electricitymaps-contrib icon indicating copy to clipboard operation
electricitymaps-contrib copied to clipboard

refactor: remove arrow from CO parser

Open nboswell216 opened this issue 11 months ago • 3 comments

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 . and poetry run format in the top level directory to format my changes.

nboswell216 avatar Mar 23 '24 05:03 nboswell216

@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?

nboswell216 avatar Mar 25 '24 22:03 nboswell216

@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).

VIKTORVAV99 avatar Mar 25 '24 22:03 VIKTORVAV99

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.

VIKTORVAV99 avatar Jun 05 '24 08:06 VIKTORVAV99