raulcd commented on issue #49935:
URL: https://github.com/apache/arrow/issues/49935#issuecomment-4387000560

   I've been able to reproduce with:
   ```python
   pandas==3.0.2
   pyarrow==24.0.0
   ```
   See:
   ```python
   Python 3.13.12 (main, Feb  4 2026, 15:06:39) [GCC 15.2.0] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import pandas as pd
   ... import pyarrow as pa
   ... 
   ... null_col = pd.array([pd.NA], dtype=pd.ArrowDtype(pa.null()))
   ... df = pd.DataFrame({"x": null_col})
   ... df_orig  = pd.DataFrame({"x": null_col})
   ... 
   >>> df.fillna(df_orig)
   /arrow/cpp/src/arrow/result.cc:27: Constructed with a non-error status: OK
   Aborted                    python
   ```
   debug trace points to `arrow::compute::internal::(anonymous 
namespace)::ReplaceMaskChunked`:
   ```gdb
   /arrow/cpp/src/arrow/result.cc:27: Constructed with a non-error status: OK   
                                                                                
                                                         
   
   Thread 1 "python" received signal SIGABRT, Aborted.
   Download failed: Invalid argument.  Continuing without source file 
./nptl/./nptl/pthread_kill.c.
   __pthread_kill_implementation (threadid=<optimized out>, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
   ⚠️ warning: 44       ./nptl/pthread_kill.c: No such file or directory
   (gdb) bt
   #0  __pthread_kill_implementation (threadid=<optimized out>, 
signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
   #1  0x00007ffff7cfbdbf in __pthread_kill_internal (threadid=<optimized out>, 
signo=6) at ./nptl/pthread_kill.c:89
   #2  0x00007ffff7ca4d02 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/posix/raise.c:26
   #3  0x00007ffff7c8c4b2 in __GI_abort () at ./stdlib/abort.c:77
   #4  0x00007fffc5fc1324 in arrow::util::ArrowLog::~ArrowLog() [clone .cold] 
() from 
/home/raulcd/code/anatomy-arrow-parquet/.venv/lib/python3.13/site-packages/pyarrow/libarrow.so.2400
   #5  0x00007fffc60f7a30 in 
arrow::internal::DieWithMessage(std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char> > const&) ()
      from 
/home/raulcd/code/anatomy-arrow-parquet/.venv/lib/python3.13/site-packages/pyarrow/libarrow.so.2400
   #6  0x00007fffc8965860 in arrow::Result<long>::Result(arrow::Status const&) 
[clone .part.0] [clone .lto_priv.0] ()
      from 
/home/raulcd/code/anatomy-arrow-parquet/.venv/lib/python3.13/site-packages/pyarrow/libarrow_compute.so.2400
   #7  0x00007fffc8ae3e8e in arrow::compute::internal::(anonymous 
namespace)::ReplaceMaskChunked<arrow::NullType>::Exec(arrow::compute::KernelContext*,
 arrow::compute::ExecBatch const&, arrow::Datum*) [clone .lto_priv.0] () from 
/home/raulcd/code/anatomy-arrow-parquet/.venv/lib/python3.13/site-packages/pyarrow/libarrow_compute.so.2400
   #8  0x00007fffc64d6818 in arrow::compute::detail::(anonymous 
namespace)::VectorExecutor::Execute(arrow::compute::ExecBatch const&, 
arrow::compute::detail::ExecListener*) ()
      from 
/home/raulcd/code/anatomy-arrow-parquet/.venv/lib/python3.13/site-packages/pyarrow/libarrow.so.2400
   #9  0x00007fffc64f4d5e in 
arrow::compute::detail::FunctionExecutorImpl::Execute(std::vector<arrow::Datum, 
std::allocator<arrow::Datum> > const&, long) ()
      from 
/home/raulcd/code/anatomy-arrow-parquet/.venv/lib/python3.13/site-packages/pyarrow/libarrow.so.2400
   #10 0x00007fffc64f3d79 in arrow::compute::(anonymous 
namespace)::ExecuteInternal(arrow::compute::Function const&, 
std::vector<arrow::Datum, std::allocator<arrow::Datum> >, long, 
arrow::compute::FunctionOptions const*, arrow::compute::ExecContext*) () from 
/home/raulcd/code/anatomy-arrow-parquet/.venv/lib/python3.13/site-packages/pyarrow/libarrow.so.2400
   #11 0x00007fffc64f4011 in 
arrow::compute::Function::Execute(std::vector<arrow::Datum, 
std::allocator<arrow::Datum> > const&, arrow::compute::FunctionOptions const*, 
arrow::compute::ExecContext*) const ()
      from 
/home/raulcd/code/anatomy-arrow-parquet/.venv/lib/python3.13/site-packages/pyarrow/libarrow.so.2400
   #12 0x00007fffbf1fdad4 in 
__pyx_pw_7pyarrow_8_compute_8Function_7call(_object*, _object* const*, long, 
_object*) [clone .lto_priv.0] ()
      from 
/home/raulcd/code/anatomy-arrow-parquet/.venv/lib/python3.13/site-packages/pyarrow/_compute.cpython-313-x86_64-linux-gnu.so
   #13 0x0000000000559303 in _PyObject_VectorcallTstate (tstate=0xa986e8 
<_PyRuntime+283048>, callable=0x7fffbf4e7520, args=<optimized out>, 
nargsf=<optimized out>, kwnames=<optimized out>)
       at ../Include/internal/pycore_call.h:168
   #14 PyObject_Vectorcall (callable=0x7fffbf4e7520, args=<optimized out>, 
nargsf=<optimized out>, kwnames=<optimized out>) at ../Objects/call.c:327
   #15 0x000000000056fa95 in _PyEval_EvalFrameDefault (tstate=<optimized out>, 
frame=<optimized out>, throwflag=<optimized out>) at 
../Python/generated_cases.c.h:813
   #16 0x0000000000623275 in _PyEval_EvalFrame (tstate=0xa986e8 
<_PyRuntime+283048>, frame=0x7ffff7faf698, throwflag=0) at 
../Include/internal/pycore_ceval.h:120
   #17 _PyEval_Vector (tstate=0xa986e8 <_PyRuntime+283048>, 
func=0x7fffbef684a0, locals=0x0, args=0x7fffffffd460, argcount=<optimized out>, 
kwnames=0x0) at ../Python/ceval.c:1820
   #18 _PyFunction_Vectorcall (func=0x7fffbef684a0, stack=0x7fffffffd460, 
nargsf=<optimized out>, kwnames=0x0) at ../Objects/call.c:413
   #19 _PyObject_VectorcallTstate (tstate=0xa986e8 <_PyRuntime+283048>, 
callable=<optimized out>, args=0x7fffffffd460, nargsf=<optimized out>, 
kwnames=0x0) at ../Include/internal/pycore_call.h:168
   #20 vectorcall_unbound (tstate=0xa986e8 <_PyRuntime+283048>, 
unbound=<optimized out>, func=<optimized out>, args=0x7fffffffd460, 
nargs=<optimized out>) at ../Objects/typeobject.c:2581
   #21 vectorcall_method (name=<optimized out>, args=<optimized out>, 
nargs=<optimized out>) at ../Objects/typeobject.c:2612
   #22 0x000000000064042d in slot_mp_ass_subscript (self=<optimized out>, 
key=<optimized out>, value=<optimized out>) at ../Objects/typeobject.c:9368
   #23 0x0000000000571201 in _PyEval_EvalFrameDefault (tstate=<optimized out>, 
frame=<optimized out>, throwflag=<optimized out>) at 
../Python/generated_cases.c.h:5803
   #24 0x00000000005dd11c in _PyObject_VectorcallTstate (tstate=0xa986e8 
<_PyRuntime+283048>, callable=0x7fffbe796200, args=0x7fffc459acd0, 
nargsf=<optimized out>, kwnames=<optimized out>)
       at ../Include/internal/pycore_call.h:168
   #25 method_vectorcall (method=<optimized out>, args=0x7fffc459acd8, 
nargsf=<optimized out>, kwnames=<optimized out>) at ../Objects/classobject.c:63
   #26 0x00000000005baa3f in _PyVectorcall_Call (tstate=0xa986e8 
<_PyRuntime+283048>, func=0x5dcfa0 <method_vectorcall>, 
callable=0x7fffbe716b00, tuple=<optimized out>, kwargs=<optimized out>)
       at ../Objects/call.c:285
   #27 _PyObject_Call (tstate=0xa986e8 <_PyRuntime+283048>, 
callable=0x7fffbe716b00, args=<optimized out>, kwargs=<optimized out>) at 
../Objects/call.c:348
   #28 0x0000000000571307 in PyObject_Call (callable=0x7fffbe716b00, 
args=0xa68e40 <_PyRuntime+88320>, kwargs=0x7fffbdefbc00) at 
../Objects/call.c:373
   #29 _PyEval_EvalFrameDefault (tstate=<optimized out>, frame=<optimized out>, 
throwflag=<optimized out>) at ../Python/generated_cases.c.h:1362
   #30 0x0000000000569544 in _PyEval_EvalFrame (tstate=0xa986e8 
<_PyRuntime+283048>, frame=0x7ffff7faf020, throwflag=0) at 
../Include/internal/pycore_ceval.h:120
   #31 _PyEval_Vector (args=0x0, argcount=0, kwnames=0x0, tstate=0xa986e8 
<_PyRuntime+283048>, func=0x7ffff7bd9440, locals=<optimized out>) at 
../Python/ceval.c:1820
   
   ```
   Probably from here, as far as I know that code is wrong because Result must 
hold either a failure or the value not `Status::OK`
   
https://github.com/apache/arrow/blob/23cd1ff8f4e33b3207875e3395d2d6b1aeb1edc2/cpp/src/arrow/compute/kernels/vector_replace.cc#L215-L230
   
   What is confusing to me is that this code has been touched for 4 years :)
   


-- 
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