Skip to content

Commit

Permalink
Remove inplace argument for dask series renaming
Browse files Browse the repository at this point in the history
See issue dask#8082
  • Loading branch information
marcelned committed Sep 10, 2021
1 parent e1974bf commit 11d20f5
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions dask/dataframe/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3168,7 +3168,7 @@ def __repr__(self):
task=len(self.dask),
)

def rename(self, index=None, inplace=False, sorted_index=False):
def rename(self, index=None, sorted_index=False):
"""Alter Series index labels or name
Function / dict values must be unique (1-to-1). Labels not contained in
Expand All @@ -3183,8 +3183,6 @@ def rename(self, index=None, inplace=False, sorted_index=False):
If dict-like or callable, the transformation is applied to the
index. Scalar or hashable sequence-like will alter the
``Series.name`` attribute.
inplace : boolean, default False
Whether to return a new Series or modify this one inplace.
sorted_index : bool, default False
If true, the output ``Series`` will have known divisions inferred
from the input series and the transformation. Ignored for
Expand Down Expand Up @@ -3212,7 +3210,7 @@ def rename(self, index=None, inplace=False, sorted_index=False):
and not is_dict_like(index)
and not isinstance(index, dd.Series)
):
res = self if inplace else self.copy()
res = self.copy()
res.name = index
else:
res = self.map_partitions(M.rename, index, enforce_metadata=False)
Expand All @@ -3229,12 +3227,6 @@ def rename(self, index=None, inplace=False, sorted_index=False):
res.divisions = tuple(methods.tolist(new))
else:
res = res.clear_divisions()
if inplace:
self.dask = res.dask
self._name = res._name
self.divisions = res.divisions
self._meta = res._meta
res = self
return res

@derived_from(pd.Series)
Expand Down

0 comments on commit 11d20f5

Please sign in to comment.