Diveyam-Mishra commented on issue #51162:
URL: https://github.com/apache/arrow/issues/51162#issuecomment-5557844786

   Thanks for filing this with a clean repro. I was able to reproduce and test 
this behavior across Pandas 2.2 / 3.0.
   Under the hood, this is a known design limitation in Pandas' Copy-on-Write 
architecture regarding external/third-party zero-copy consumers:
   Immediate Workaround: PyArrow Backend
   
   For users looking for guaranteed buffer independence and immutability under 
CoW today, using the PyArrow backend in Pandas completely avoids this issue:
   ```python
   # Using PyArrow-backed dtypes
   df = pd.DataFrame({"a": [1, 2, 3]}, dtype="int64[pyarrow]")
   table = pa.Table.from_pandas(df)
   
   df.iloc[0, 0] = 999
   
   print(table.column("a").to_pylist())  # [1, 2, 3]
   print(df["a"].to_list())             # [999, 2, 3]
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to