Skip to content

Commit

Permalink
Handle NA cudf.Scalar in div by zero check
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed Nov 8, 2022
1 parent 603fdbb commit f023aea
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion python/cudf/cudf/core/column/numerical.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,14 @@ def _binaryop(self, other: ColumnBinaryOperand, op: str) -> ColumnBase:
and (tmp.dtype.type != np.bool_)
and (
(
(np.isscalar(tmp) or isinstance(tmp, cudf.Scalar))
(
np.isscalar(tmp)
or (
isinstance(tmp, cudf.Scalar)
# host to device copy
and (tmp.value is not pd.NA)
)
)
and (0 == tmp)
)
or ((isinstance(tmp, NumericalColumn)) and (0 in tmp))
Expand Down

0 comments on commit f023aea

Please sign in to comment.