-
Notifications
You must be signed in to change notification settings - Fork 6
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
Another issue deserializing Interval #80
Comments
btw - this worked. I'm sure if you need help I could help figure out how to do this at a broader scale if I'm stuck at any point. |
What's interesting about this bug is that I do not believe we should be attempting to parse Interval strings at all. When we deserialize datetime values, we do need to parse a variety of string formats to attempt to match, but that's not what should be happening when deserializing an Interval column type. Intervals should be serialized to the number of seconds (an integer value), and then deserialized to a Can you provide some more background on this:
|
In writing my API - my client side said they'd like to send (because of this):
However - I've managed to get them to send some form of this:
And this is currently the code I'm running (Hopefully I don't have to worry about crossing days... :-D):
|
Hrm. So it turns out this issue is a little trickier than initially diagnosed. On the one hand, as mentioned above, one (part) of the issue is that you were trying to coerce a string that expressed an amount of time (e.g. However, there's a second layer of problem that is occurring here, which is that whether an The date arithmetic and the type conversions are the easy part - the hard part is figuring out how to differentiate a native |
Using 0.5.0 - I'm not sure how much work you want to go into this:
Based on the chain of exceptions in the stack - it looks like you're rolling down a track of "potentially workable interval strings"
Have you thought about using something closer to this?
http://kbyanc.blogspot.com/2007/08/python-reconstructing-timedeltas-from.html
It's older code - but it looks like it would be able to help you parse through and instantly get your timedelta object.
In the mean time - I'm going to write my own function that's based on this and just do a on_deserialize for interval objects.
The text was updated successfully, but these errors were encountered: