-
-
Notifications
You must be signed in to change notification settings - Fork 141
ENH: Improve typing for Timedelta #388
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
Conversation
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.
Picked up a number of issue. Let's get this one right, then will probably need to make similar changes for the Timestamp
PR, so once this one is approved, then make similar changes there and I will then review.
Once you have addressed my comments, and the new version of |
@Dr-Irv All green and all comments addressed. |
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.
Sorry for the delay in this review. Had some other projects at work come up.
There was one case where you resolved the conversation saying you made a change, but I didn't see it.
In addition, if you have a test like this:
check(assert_type(td % int_series, TimedeltaSeries), pd.Series)
can you change it to
check(assert_type(td % int_series, TimedeltaSeries), pd.Series, pd.Timestamp)
which will then check that the first element of the Series
is a Timestamp
. So anytime you are calling check()
and you expect a Series
, we can also check what we expect to be inside the Series
(at least for the first element)
There's a number of tests like this, and I didn't mark any of them, so the above is just one example.
I got all of these. |
|
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.
A few small things, then should be good to go
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.
thanks @bashtage
* ENH: Improve typing for Timedelta * ENH: Improve typing of timedelta * ENH/TST: Improve Timedelta and its tests * ENH: Final changes for timedelta * ENH: Further improvements to timestamp * ENH: Add more types * Final changes to timedelta * Final cleanup * CLN: Final clean * CLN: Final clean Co-authored-by: Kevin Sheppard <[email protected]>
* MAINT: Fix for future change * ENH: Add pytest warns context manager manager * Switch to pandas Version * ENH: Improve typing for Timedelta (#388) * ENH: Improve typing for Timedelta * ENH: Improve typing of timedelta * ENH/TST: Improve Timedelta and its tests * ENH: Final changes for timedelta * ENH: Further improvements to timestamp * ENH: Add more types * Final changes to timedelta * Final cleanup * CLN: Final clean * CLN: Final clean Co-authored-by: Kevin Sheppard <[email protected]> * ENH: Add typing for Version Co-authored-by: Kevin Sheppard <[email protected]>
assert_type()
to assert the type of any return valuexref #383