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. |
| # Pass in a type instance. | ||
| ( | ||
| dict(column_dtypes=np.unicode), | ||
| dict(column_dtypes=str), |
There was a problem hiding this comment.
Since we only support python3 str works here.
| "week", | ||
| "weekofyear", |
There was a problem hiding this comment.
This fixes warnings coming from pandas. Unrelated to the numpy changes.
| 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.
| return object | |
| return np.dtype("object") |
(to ensure this function actually returns a dtype object, as its type annotation indicates)
| # 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.
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.boolwithnp.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.