Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ni): remove usage of arrow from NI parser #6616

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

amv213
Copy link
Contributor

@amv213 amv213 commented Apr 2, 2024

Issue

#6135

Description

This PR removes the dependency on arrow from the NI parser.

Double check

  • I have tested my parser changes locally with poetry run test_parser "zone_key"
  • I have run pnpx prettier@2 --write . and poetry run format in the top level directory to format my changes.

@amv213 amv213 requested a review from VIKTORVAV99 as a code owner April 2, 2024 12:46
@github-actions github-actions bot added parser python Pull requests that update Python code labels Apr 2, 2024
Copy link
Member

@VIKTORVAV99 VIKTORVAV99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question really, otherwise things look good.

return datetime_datetime
def get_time_from_system_map(text: str) -> datetime:
# date format is: "'Información en Tiempo Real al 02/04/2024 05:57:40 AM'"
datetime_text = extract_text(text, "en Tiempo Real al ", "'")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this datetime_text change?

Copy link
Contributor Author

@amv213 amv213 Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They seem to have changed the subtitle on their webpage sometime between 2023/06/02 and 2023/11/28 👀

but the arrow code wasn't failing because arrow.get() is apparently able to extract the date even if parsing the full html returned by extract_text not matching anything

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man arrow is filled with crazy unexpected stuff!

I'm glad we are removing it!

@VIKTORVAV99 VIKTORVAV99 enabled auto-merge (squash) April 2, 2024 13:57
@VIKTORVAV99 VIKTORVAV99 merged commit 4559ba4 into electricitymaps:master Apr 2, 2024
19 checks passed
@amv213 amv213 deleted the amv213/remove-arrow-ni branch April 2, 2024 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants