Skip to content

Commit

Permalink
Validate 'how' in Cython
Browse files Browse the repository at this point in the history
  • Loading branch information
shwina committed Jun 10, 2021
1 parent b1db657 commit b15a761
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions python/cudf/cudf/_lib/round.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ def round(Column input_col, int decimal_places=0, how="half_even"):
-------
A Column with values rounded to the given number of decimal places
"""
if how not in {"half_even", "half_up"}:
raise ValueError("'how' must be either 'half_even' or 'half_up'")

cdef column_view input_col_view = input_col.view()
cdef unique_ptr[column] c_result
Expand Down
2 changes: 0 additions & 2 deletions python/cudf/cudf/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -4776,8 +4776,6 @@ def round(self, decimals=0, how="half_even"):
2 3.0
dtype: float64
"""
if how not in {"half_up", "half_even"}:
raise ValueError("'how' must be either 'half_even' or 'half_up'")
return Series(
self._column.round(decimals=decimals, how=how),
name=self.name,
Expand Down

0 comments on commit b15a761

Please sign in to comment.