-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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
Replaced np.bool refs; fix CI failure #34835
Conversation
Looks like also need np.complex? |
Pushed a batch of |
The last run (https://travis-ci.org/github/pandas-dev/pandas/jobs/699299640#L3736) passed, but there were still many warnings. Because we don't run that job with Anyway, hopefully these are all caught now. |
@@ -163,7 +163,7 @@ def test_to_records_with_categorical(self): | |||
), | |||
# Pass in a type instance. | |||
( | |||
dict(column_dtypes=np.unicode), | |||
dict(column_dtypes=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.
Since we only support python3 str
works here.
"week", | ||
"weekofyear", |
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.
This fixes warnings coming from pandas. Unrelated to the numpy changes.
@@ -1483,7 +1483,7 @@ def find_common_type(types: List[DtypeObj]) -> DtypeObj: | |||
if has_bools: | |||
for t in types: | |||
if is_integer_dtype(t) or is_float_dtype(t) or is_complex_dtype(t): | |||
return np.object | |||
return object |
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.
return object | |
return np.dtype("object") |
(to ensure this function actually returns a dtype object, as its type annotation indicates)
@@ -264,7 +264,7 @@ def hash_array( | |||
|
|||
# First, turn whatever array this is into unsigned 64-bit ints, if we can | |||
# manage it. | |||
elif isinstance(dtype, np.bool): | |||
elif isinstance(dtype, bool): |
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.
I am not sure if this can ever be correct:
In [18]: isinstance(np.dtype(bool), bool)
Out[18]: False
unless dtype
is not actually a dtype ...
after this would be nice to have a lint rule to catch these if possible (as it would fail much sooner than the 3.9 CI) |
Opened #34852 to fail on warnings for that build. I'd like to get CI passing first for other PRs though. |
Good to merge when CI passes? |
Has anyone seen this failure on npdev before? Restarting that build.
|
The 3.9 build passed, with a few warnings I can't track down yet
I'll handle those in #34852 |
lgtm @jreback . thanks Tom for pushing this through |
1 similar comment
lgtm @jreback . thanks Tom for pushing this through |
xref numpy/numpy#14882 |
I mostly just replace
np.bool
withnp.bool_
though there are some other cases where I just used bool. I don't know if it matters...so happy to conform one way or anotherFor now just seeing if this fixes CI
Closes #34848.