Skip to content

Commit

Permalink
FIX-#4570: Replace np.bool -> np.bool_
Browse files Browse the repository at this point in the history
I was getting:
  DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.
  Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

I assume that this is the correct substitution, instead of chaning to a simple `bool`, but I don't understand what this code does here, so I may be wrong.

Signed-off-by: Nick Crews <nicholas.b.crews@gmail.com>
  • Loading branch information
NickCrews committed Jun 11, 2022
1 parent d5ff94e commit 03e0203
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions modin/core/storage_formats/pandas/query_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,13 +1347,13 @@ def stack(self, level, dropna):
applymap = Map.register(pandas.DataFrame.applymap)
conj = Map.register(lambda df, *args, **kwargs: pandas.DataFrame(np.conj(df)))
invert = Map.register(pandas.DataFrame.__invert__)
isin = Map.register(pandas.DataFrame.isin, dtypes=np.bool)
isna = Map.register(pandas.DataFrame.isna, dtypes=np.bool)
isin = Map.register(pandas.DataFrame.isin, dtypes=np.bool_)
isna = Map.register(pandas.DataFrame.isna, dtypes=np.bool_)
_isfinite = Map.register(
lambda df, *args, **kwargs: pandas.DataFrame(np.isfinite(df))
)
negative = Map.register(pandas.DataFrame.__neg__)
notna = Map.register(pandas.DataFrame.notna, dtypes=np.bool)
notna = Map.register(pandas.DataFrame.notna, dtypes=np.bool_)
round = Map.register(pandas.DataFrame.round)
replace = Map.register(pandas.DataFrame.replace)
series_view = Map.register(
Expand All @@ -1373,22 +1373,22 @@ def stack(self, level, dropna):

str_capitalize = Map.register(_str_map("capitalize"), dtypes="copy")
str_center = Map.register(_str_map("center"), dtypes="copy")
str_contains = Map.register(_str_map("contains"), dtypes=np.bool)
str_contains = Map.register(_str_map("contains"), dtypes=np.bool_)
str_count = Map.register(_str_map("count"), dtypes=int)
str_endswith = Map.register(_str_map("endswith"), dtypes=np.bool)
str_endswith = Map.register(_str_map("endswith"), dtypes=np.bool_)
str_find = Map.register(_str_map("find"), dtypes="copy")
str_findall = Map.register(_str_map("findall"), dtypes="copy")
str_get = Map.register(_str_map("get"), dtypes="copy")
str_index = Map.register(_str_map("index"), dtypes="copy")
str_isalnum = Map.register(_str_map("isalnum"), dtypes=np.bool)
str_isalpha = Map.register(_str_map("isalpha"), dtypes=np.bool)
str_isdecimal = Map.register(_str_map("isdecimal"), dtypes=np.bool)
str_isdigit = Map.register(_str_map("isdigit"), dtypes=np.bool)
str_islower = Map.register(_str_map("islower"), dtypes=np.bool)
str_isnumeric = Map.register(_str_map("isnumeric"), dtypes=np.bool)
str_isspace = Map.register(_str_map("isspace"), dtypes=np.bool)
str_istitle = Map.register(_str_map("istitle"), dtypes=np.bool)
str_isupper = Map.register(_str_map("isupper"), dtypes=np.bool)
str_isalnum = Map.register(_str_map("isalnum"), dtypes=np.bool_)
str_isalpha = Map.register(_str_map("isalpha"), dtypes=np.bool_)
str_isdecimal = Map.register(_str_map("isdecimal"), dtypes=np.bool_)
str_isdigit = Map.register(_str_map("isdigit"), dtypes=np.bool_)
str_islower = Map.register(_str_map("islower"), dtypes=np.bool_)
str_isnumeric = Map.register(_str_map("isnumeric"), dtypes=np.bool_)
str_isspace = Map.register(_str_map("isspace"), dtypes=np.bool_)
str_istitle = Map.register(_str_map("istitle"), dtypes=np.bool_)
str_isupper = Map.register(_str_map("isupper"), dtypes=np.bool_)
str_join = Map.register(_str_map("join"), dtypes="copy")
str_len = Map.register(_str_map("len"), dtypes=int)
str_ljust = Map.register(_str_map("ljust"), dtypes="copy")
Expand All @@ -1409,7 +1409,7 @@ def stack(self, level, dropna):
str_slice = Map.register(_str_map("slice"), dtypes="copy")
str_slice_replace = Map.register(_str_map("slice_replace"), dtypes="copy")
str_split = Map.register(_str_map("split"), dtypes="copy")
str_startswith = Map.register(_str_map("startswith"), dtypes=np.bool)
str_startswith = Map.register(_str_map("startswith"), dtypes=np.bool_)
str_strip = Map.register(_str_map("strip"), dtypes="copy")
str_swapcase = Map.register(_str_map("swapcase"), dtypes="copy")
str_title = Map.register(_str_map("title"), dtypes="copy")
Expand Down

0 comments on commit 03e0203

Please sign in to comment.