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: use event classes in US-SPP parser #6553

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

yujia21
Copy link
Contributor

@yujia21 yujia21 commented Mar 11, 2024

Issue

6011

Description

Use event classes in US-SPP parser

Preview

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.

@github-actions github-actions bot added parser python Pull requests that update Python code tests labels Mar 11, 2024
@VIKTORVAV99 VIKTORVAV99 self-requested a review March 23, 2024 08:16
parsers/US_SPP.py Show resolved Hide resolved
Comment on lines 343 to 351
def fetch_historical_exchange(
zone_key1: str,
zone_key2: str,
zone_key1: ZoneKey,
zone_key2: ZoneKey,
session: Session | None = None,
target_datetime: datetime | None = None,
logger: Logger = getLogger(__name__),
) -> list:
) -> list[dict[str, Any]]:
filename = target_datetime.strftime("TieFlows_%b%Y.csv")
file_url = f"{US_PROXY}/file-browser-api/download/historical-tie-flow?{HOST_PARAMETER}&path={filename}"
Copy link
Member

Choose a reason for hiding this comment

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

Not really part of your changes but I don't think the target datetime should be None here, type wise. Or it should be checked that it's not none before the filename is generated as .strftime is not available on None.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed both! Sorry it's been a while!

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 tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants