-
Notifications
You must be signed in to change notification settings - Fork 40
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
Getting quotes for dates older than 1st of January 1970 #56
Comments
Happy to work on this this is wanted, the change is very easy. Might need some discussion though as there are two ways I see we could fix this:
Also...
|
Don't know really how big this project is, but could leave this as a "Good first issue" label so rust beginners can do it. They should be able to do what I said above and just follow the compiler around until it is happy with all the typing. |
I would prefer Solution 1. Code duplication is never a good idea and unfortunately, since yahoo changes the api occasionally anyway (or just stops delivering certain values in some cases, such that parameters need to be changed to become optional), strictly prohibiting breaking changes is not option. It would be even better to parse the timestamp in a proper date time. However, because of the missing time zone information, this is difficult to be done correctly. Therefore, just switching to i64 might be the best we could do , if date before 1970 is really needed (I wasn't aware that yahoo is offering data before 1970. |
Description
The
YResponse
serialization fails when trying to access quote history older than 1st of January 1970. This is due to the timestamp of these dates becoming a negative integer.For example, take the following code:
The timestamps in the quotes are expected to be
u64
so negative integers make the request fail.Proposition
Change the timestamps type to be a
i64
to allow for negative timestamps.The text was updated successfully, but these errors were encountered: