-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
CLN: Remove type definitions from pandas.compat #25903
Conversation
Note that these changes now reduce the pandas/pandas/core/dtypes/inference.py Lines 69 to 90 in 6701e71
Does it make sense to deprecate |
I would be +1 on replacing that function with isinstance checks - if anything I think it will make static code analysis cleaner |
Codecov Report
@@ Coverage Diff @@
## master #25903 +/- ##
==========================================
+ Coverage 91.53% 91.56% +0.02%
==========================================
Files 175 175
Lines 52808 52747 -61
==========================================
- Hits 48338 48297 -41
+ Misses 4470 4450 -20
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #25903 +/- ##
==========================================
+ Coverage 91.77% 91.79% +0.01%
==========================================
Files 175 175
Lines 52606 52538 -68
==========================================
- Hits 48280 48228 -52
+ Misses 4326 4310 -16
Continue to review full report at Codecov.
|
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.
lgtm - over to you @jreback
@@ -1711,8 +1709,7 @@ def to_records(self, index=True, convert_datetime64=None, | |||
# string naming a type. | |||
if dtype_mapping is None: | |||
formats.append(v.dtype) | |||
elif isinstance(dtype_mapping, (type, np.dtype, | |||
compat.string_types)): | |||
elif isinstance(dtype_mapping, (type, np.dtype, str)): |
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.
Just thinking out loud but wondering if we should make something to fuse type, np.dtype and str. Would certainly help out in some of the typing things we have going on
can merge master. sorry i think merged something else and causes conflicts. |
thanks @jschendel |
git diff upstream/master -u -- "*.py" | flake8 --diff
Removes the following:
string_types
text_types
binary_types
string_and_binary_types
strlen
len
, so just directly calledlen
east_asian_len
EastAsianTextAdjustment.len
inpandas/io/formats/format.py
EastAsianTextAdjustment.len
instead