-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[DS][26/n] Update internal representation of InLatestTimeWindow #21615
[DS][26/n] Update internal representation of InLatestTimeWindow #21615
Conversation
bf37d9b
to
c3c890f
Compare
5256f73
to
d63a0f5
Compare
lookback_days: int = 0 | ||
lookback_seconds: int = 0 | ||
lookback_microseconds: int = 0 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth nothing as comment that
>>> timedelta().days
0
>>> timedelta().seconds
0
>>> timedelta().microseconds
0
I went to the REPL and checked this to ensure it wasn't None
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And actually I think you should make these optional to distinguish from the zero case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make the serialized representation nullable to distinguihs from the default/empty timedelta
.
I also recommend making it a tuple so there is only one Noneable property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change serialization format
d63a0f5
to
c1120be
Compare
c3c890f
to
3ccd4be
Compare
c1120be
to
102f170
Compare
3ccd4be
to
7b5f20e
Compare
102f170
to
a226325
Compare
a226325
to
29f9484
Compare
29f9484
to
0534e7c
Compare
f34a068
to
f9c81a0
Compare
Merge activity
|
f9c81a0
to
e678b9c
Compare
…ter-io#21615) ## Summary & Motivation Updates the internal representation to better match the timedelta class. The painful thing here is that you can't really set a constructor when using pydantic models. Not a huge fan of representing "no timedelta at all" as "all the things are 0" ## How I Tested These Changes
Summary & Motivation
Updates the internal representation to better match the timedelta class. The painful thing here is that you can't really set a constructor when using pydantic models.
Not a huge fan of representing "no timedelta at all" as "all the things are 0"
How I Tested These Changes