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

Fixes hash_crossed with cudf 21.12 #1376

Merged
merged 6 commits into from
Jan 31, 2022
Merged
Changes from 1 commit
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
7 changes: 5 additions & 2 deletions nvtabular/ops/hashed_cross.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import numpy

from nvtabular.dispatch import DataFrameType, _hash_series, annotate
from nvtabular.dispatch import DataFrameType, _hash_series, _is_series_object, annotate

from .operator import ColumnSelector, Operator

Expand Down Expand Up @@ -59,7 +59,10 @@ def transform(self, col_selector: ColumnSelector, df: DataFrameType) -> DataFram
for cross in _nest_columns(col_selector.names):
val = 0
for column in cross:
val ^= _hash_series(df[column]) # or however we want to do this aggregation
if _is_series_object(val):
val ^= _hash_series(df[column]) # or however we want to do this aggregation
else:
val = _hash_series(df[column])
albert17 marked this conversation as resolved.
Show resolved Hide resolved

if isinstance(self.num_buckets, dict):
val = val % self.num_buckets[cross]
Expand Down