Skip to content

Commit

Permalink
Remove inplace argument from set_axis for Pandas 2 (#28536)
Browse files Browse the repository at this point in the history
  • Loading branch information
caneff authored Sep 19, 2023
1 parent a90879a commit f2a0c76
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions sdks/python/apache_beam/dataframe/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -1901,7 +1901,8 @@ def dropna(self, **kwargs):

@frame_base.with_docs_from(pd.Series)
@frame_base.args_to_kwargs(pd.Series)
@frame_base.populate_defaults(pd.Series)
@frame_base.populate_defaults(
pd.Series, removed_args=['inplace'] if PD_VERSION >= (2, 0) else None)
@frame_base.maybe_inplace
def set_axis(self, labels, **kwargs):
# TODO: assigning the index is generally order-sensitive, but we could
Expand Down Expand Up @@ -2675,7 +2676,9 @@ def set_index(self, keys, **kwargs):

@frame_base.with_docs_from(pd.DataFrame)
@frame_base.args_to_kwargs(pd.DataFrame)
@frame_base.populate_defaults(pd.DataFrame)
@frame_base.populate_defaults(
pd.DataFrame,
removed_args=['inplace'] if PD_VERSION >= (2, 0) else None)
@frame_base.maybe_inplace
def set_axis(self, labels, axis, **kwargs):
if axis in ('index', 0):
Expand Down

0 comments on commit f2a0c76

Please sign in to comment.