diff --git a/CHANGELOG.md b/CHANGELOG.md index b9f997b842c..41f9575e5cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -91,6 +91,7 @@ - Stopped ignoring nanoseconds in `pd.Timedelta` scalars. - Fixed AssertionError in tree of binary operations. +- Fixed `inplace` argument for Series objects derived from DataFrame columns. #### Behavior Change diff --git a/src/snowflake/snowpark/modin/pandas/series.py b/src/snowflake/snowpark/modin/pandas/series.py index 6e1b93437a8..7fb73ebbd37 100644 --- a/src/snowflake/snowpark/modin/pandas/series.py +++ b/src/snowflake/snowpark/modin/pandas/series.py @@ -2752,8 +2752,6 @@ def _update_inplace(self, new_query_compiler): # Propagate changes back to parent so that column in dataframe had the same contents if self._parent is not None: if self._parent_axis == 0: - self._parent.loc[self.name] = self - else: self._parent[self.name] = self def _create_or_update_from_compiler(self, new_query_compiler, inplace=False): diff --git a/tests/integ/modin/series/test_fillna.py b/tests/integ/modin/series/test_fillna.py index 567f45db084..9371cd0dcd1 100644 --- a/tests/integ/modin/series/test_fillna.py +++ b/tests/integ/modin/series/test_fillna.py @@ -188,3 +188,16 @@ def test_argument_negative(test_fillna_series, test_fillna_df): expect_exception_type=TypeError, assert_exception_equal=False, ) + + +@sql_count_checker(query_count=1) +def test_inplace_fillna_from_df(): + def inplace_fillna(df): + df["B"].fillna(method="ffill", inplace=True) + return df + + eval_snowpark_pandas_result( + pd.DataFrame([[1, 2, 3], [4, None, 6]], columns=list("ABC")), + native_pd.DataFrame([[1, 2, 3], [4, None, 6]], columns=list("ABC")), + inplace_fillna, + )