Repository navigation
[MAINT] update compat to remove unusable shims e.g. py26 - #5000
Conversation
|
LGTM |
|
A couple more that I think are not relevant any more: RangeIndex is in Pandas 0.18+ |
Thanks, will update. |
|
Should we get rid of NumpyVersion while we’re at it? |
If it is completely unused then let it go. |
I very much agree, but in the past @josef-pkt has insisted on keeping code that is not used internally on the theory that it might be used externally. Waiting for the go-ahead on this one. |
|
Turns out we can get NumpyVersion from numpy.lib since 1.9.0. Also some of the pandas shims are no longer needed. Updated. |
|
|
||
| import numpy as np | ||
| import pandas | ||
| from pandas import RangeIndex, Float64Index # noqa:F401 |
There was a problem hiding this comment.
Ideally, anything that not needed from compat should be directly imported from the package that provides it.
| from pandas import RangeIndex | ||
| except ImportError: | ||
| RangeIndex = tuple() | ||
| def sort_values(df, *args, **kwargs): |
There was a problem hiding this comment.
Same here -- we shouldn't be calling compat.sort_values (df) but df.sort_values()
There was a problem hiding this comment.
I agree, prefer to do this in a subsequent pass as the diff would touch a bunch of other files.
That refers to different type of code, i.e. you wanted delete functions that are only user facing and we don't use them internally. |
Codecov Report
@@ Coverage Diff @@
## master #5000 +/- ##
==========================================
+ Coverage 81.42% 81.43% +<.01%
==========================================
Files 582 582
Lines 90124 90076 -48
Branches 10096 10088 -8
==========================================
- Hits 73384 73352 -32
+ Misses 14435 14422 -13
+ Partials 2305 2302 -3
Continue to review full report at Codecov.
|
|
@josef-pkt good to go |
|
@jbrockmendel @bashtage Thank you |
After this, compat.scipy.NumpyVersion is never used, may be removable in a follow-up.