[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest released version of Modin.
[X] I have confirmed this bug exists on the main branch of Modin. (In order to do this you can follow this guide.)
Reproducible Example
$ MODIN_ENGINE=python ipython
Python 3.12.5 (main, Aug 14 2024, 05:08:31) [Clang 18.1.8 ]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.27.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import modin.pandas as mpd
In [2]: df = mpd.DataFrame({'a': [1,2,3], 'b': [4,5,6], 'c': [7,8,9]}).convert_dtypes(dtype_backend='pyarrow')
In [3]: df.loc[:, 'a'].iloc[[1, 0]] = [999, 888]
In [4]: df
Out[4]: FutureWarning: The behavior of DataFrame concatenation with empty or all-NA entries is deprecated. In a future version, this will no longer exclude empty or all-NA columns when determining the result dtypes. To retain the old behavior, exclude the relevant entries before the concat operation.
a b c
0 1 4 7
1 2 5 8
2 3 6 9
a <NA> <NA> <NA>
Issue Description
df got an extra row added?
Expected Behavior
df shouldn't get an extra row
pandas:
In [5]: import pandas as pd
In [6]: df = pd.DataFrame({'a': [1,2,3], 'b': [4,5,6], 'c': [7,8,9]}).convert_dtypes(dtype_backend='pyarrow')
In [7]: df.loc[:, 'a'].iloc[[1, 0]] = [999, 888]
FutureWarning: ChainedAssignmentError: behaviour will change in pandas 3.0!
You are setting values through chained assignment. Currently this works in certain cases, but when using Copy-on-Write (which will become the default behaviour in pandas 3.0) this will never work to update the original DataFrame or Series, because the intermediate object on which we are setting values will behave as a copy.
A typical example is when you are setting values in a column of a DataFrame, like:
df["col"][row_indexer] = value
Use `df.loc[row_indexer, "col"] = values` instead, to perform the assignment in a single step and ensure this keeps updating the original `df`.
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
In [8]: df
Out[8]:
a b c
0 888 4 7
1 999 5 8
2 3 6 9
I'm not too bothered about whether the [888, 999] changes carries through, but the fact that df got an extra row inserted looks wrong
Error Logs
```python-traceback
Replace this line with the error backtrace (if applicable).
```
Modin version checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest released version of Modin.
[X] I have confirmed this bug exists on the main branch of Modin. (In order to do this you can follow this guide.)
Reproducible Example
Issue Description
df
got an extra row added?Expected Behavior
df
shouldn't get an extra rowpandas:
I'm not too bothered about whether the
[888, 999]
changes carries through, but the fact thatdf
got an extra row inserted looks wrongError Logs
Installed Versions