Skip to content

Commit

Permalink
Inline copy logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
vyasr committed Aug 10, 2021
1 parent 2fdaccf commit a031e8a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions python/cudf/cudf/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3008,11 +3008,10 @@ def astype(self, dtype, copy=False, errors="raise"):
return self.copy(deep=copy)
try:
data = self._column.astype(dtype)
if copy:
data = data.copy(deep=True)

return self._from_data(
{self.name: data.copy(deep=True)}, index=self._index
{self.name: (data.copy(deep=True) if copy else data)},
index=self._index,
)

except Exception as e:
Expand Down

0 comments on commit a031e8a

Please sign in to comment.