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

Check contract details has time zone ID #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

djkelleher
Copy link

Contracts about to expire may not have tradingHours, liquidHours, and timeZoneId set. This was causing an error when _parseSessions is called:

Exception has occurred: ValueError
ZoneInfo keys must be normalized relative paths, got: 

A simple way to avoid the error would be to check if the argument string is empty.

@mattsta
Copy link
Contributor

mattsta commented May 16, 2024

Is this related to the input s or only the self.timeZoneId value?

Perhaps when s is empty then self.timeZoneId is also empty or invalid?

It looks like the fix works either way, but technically the s.split() already skips an empty s, so we are actually just checking if self.timeZoneId is a problem.

@djkelleher
Copy link
Author

It's currently written for the expected behavior: if s is non-empty then timeZoneId should be valid. If s is empty then timeZoneId may not be valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants