From d8aefc0082fbe21d1c31f9e68be4497d1b8a6af4 Mon Sep 17 00:00:00 2001 From: Oliver Holworthy <1216955+oliverholworthy@users.noreply.github.com> Date: Fri, 23 Jun 2023 15:00:14 +0100 Subject: [PATCH 1/3] Replace deprecated np.bool with bool in FillMisisng operator --- nvtabular/ops/fill.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nvtabular/ops/fill.py b/nvtabular/ops/fill.py index 2bd9405c6a..b38383b7c3 100644 --- a/nvtabular/ops/fill.py +++ b/nvtabular/ops/fill.py @@ -75,7 +75,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__ @@ -143,5 +143,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 From be6b2837c4739b1bb01b6bbaf225404466acd88d Mon Sep 17 00:00:00 2001 From: Oliver Holworthy <1216955+oliverholworthy@users.noreply.github.com> Date: Fri, 23 Jun 2023 18:43:28 +0100 Subject: [PATCH 2/3] remove unused numpy import --- nvtabular/ops/fill.py | 1 - 1 file changed, 1 deletion(-) diff --git a/nvtabular/ops/fill.py b/nvtabular/ops/fill.py index b38383b7c3..4d6511fda0 100644 --- a/nvtabular/ops/fill.py +++ b/nvtabular/ops/fill.py @@ -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 From a12c1d8c5a914ba79b30ca7963ed3dd4e780c956 Mon Sep 17 00:00:00 2001 From: Oliver Holworthy <1216955+oliverholworthy@users.noreply.github.com> Date: Fri, 23 Jun 2023 19:00:18 +0100 Subject: [PATCH 3/3] Replace np.long with int --- nvtabular/tools/data_gen.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nvtabular/tools/data_gen.py b/nvtabular/tools/data_gen.py index 70dc2ca775..d6037ee6f2 100644 --- a/nvtabular/tools/data_gen.py +++ b/nvtabular/tools/data_gen.py @@ -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 @@ -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")