Skip to content
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

Remove usage of deprecated np.bool and np.long #1851

Merged
merged 4 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions nvtabular/ops/fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
# limitations under the License.
#
import dask.dataframe as dd
import numpy as np

from merlin.core.dispatch import DataFrameType, annotate
from merlin.dag.ops.stat_operator import StatOperator
Expand Down Expand Up @@ -75,7 +74,7 @@ def column_mapping(self, col_selector):
def _compute_dtype(self, col_schema, input_schema):
col_schema = super()._compute_dtype(col_schema, input_schema)
if col_schema.name.endswith("_filled"):
col_schema = col_schema.with_dtype(np.bool)
col_schema = col_schema.with_dtype(bool)
return col_schema

transform.__doc__ = Operator.transform.__doc__
Expand Down Expand Up @@ -143,5 +142,5 @@ def column_mapping(self, col_selector):
def _compute_dtype(self, col_schema, input_schema):
col_schema = super()._compute_dtype(col_schema, input_schema)
if col_schema.name.endswith("_filled"):
col_schema = col_schema.with_dtype(np.bool)
col_schema = col_schema.with_dtype(bool)
return col_schema
8 changes: 4 additions & 4 deletions nvtabular/tools/data_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ def create_cats(self, size, cats_rep, entries=False):
if col.multi_min and col.multi_max:
if HAS_GPU:
ser = dist.create_col(
col_size + 1, dtype=np.long, min_val=col.multi_min, max_val=col.multi_max
col_size + 1, dtype=int, min_val=col.multi_min, max_val=col.multi_max
)
ser = make_series(np.ceil(ser)).astype(ser.dtype)
_cumsum = xp.cumsum
else:
ser = dist.create_col(
col_size + 1, dtype=np.long, min_val=col.multi_min, max_val=col.multi_max
col_size + 1, dtype=int, min_val=col.multi_min, max_val=col.multi_max
)
ser = make_df(np.ceil(ser))[0]
_cumsum = np.cumsum
Expand All @@ -130,12 +130,12 @@ def create_cats(self, size, cats_rep, entries=False):
offs = offs.astype("int32")
if HAS_GPU:
ser = dist.create_col(
col_size, dtype=np.long, min_val=col.min_val, max_val=col.cardinality
col_size, dtype=int, min_val=col.min_val, max_val=col.cardinality
)
ser = make_series(np.ceil(ser)).astype(ser.dtype)
else:
ser = dist.create_col(
col_size, dtype=np.long, min_val=col.min_val, max_val=col.cardinality
col_size, dtype=int, min_val=col.min_val, max_val=col.cardinality
)
ser = make_df(np.ceil(ser))[0]
ser = ser.astype("int32")
Expand Down
Loading