-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Avoid unnecessary use of _coerce_scalar_to_timedelta_type #24793
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
@@ -569,16 +569,14 @@ def coerce_to_dtypes(result, dtypes): | |||
if len(result) != len(dtypes): | |||
raise AssertionError("_coerce_to_dtypes requires equal len arrays") | |||
|
|||
from pandas.core.tools.timedeltas import _coerce_scalar_to_timedelta_type | |||
|
|||
def conv(r, dtype): | |||
try: |
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.
btw an upcoming PR is going to make the try/except part of this function unnecessary.
Codecov Report
@@ Coverage Diff @@
## master #24793 +/- ##
===========================================
- Coverage 92.38% 42.91% -49.48%
===========================================
Files 166 166
Lines 52382 52379 -3
===========================================
- Hits 48395 22478 -25917
- Misses 3987 29901 +25914
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #24793 +/- ##
==========================================
- Coverage 92.38% 92.38% -0.01%
==========================================
Files 166 166
Lines 52382 52379 -3
==========================================
- Hits 48395 48391 -4
- Misses 3987 3988 +1
Continue to review full report at Codecov.
|
thanks, there is 1 last use in pytables I think can be removed? |
There's one use left in tools.timedeltas (same place where it is defined) and a handful of tests. I'll see if we can remove it altogether |
In nearly all the places where its used, we can just use
Timedelta
instead. Way simpler, avoids using a private function.