--- apache-arrow-16.1.0/python/pyarrow/src/arrow/python/udf.cc.orig 2024-06-10 11:44:14.380323276 -0400 +++ apache-arrow-16.1.0/python/pyarrow/src/arrow/python/udf.cc 2024-06-10 11:44:38.686911541 -0400 @@ -47,7 +47,7 @@ // function needs to be destroyed at process exit // and Python may no longer be initialized. ~PythonUdfKernelState() { - if (_Py_IsFinalizing()) { + if (Py_IsFinalizing()) { function->detach(); } } @@ -64,7 +64,7 @@ // function needs to be destroyed at process exit // and Python may no longer be initialized. ~PythonUdfKernelInit() { - if (_Py_IsFinalizing()) { + if (Py_IsFinalizing()) { function->detach(); } } @@ -132,7 +132,7 @@ // function needs to be destroyed at process exit // and Python may no longer be initialized. ~PythonTableUdfKernelInit() { - if (_Py_IsFinalizing()) { + if (Py_IsFinalizing()) { function_maker->detach(); } } @@ -173,7 +173,7 @@ }; ~PythonUdfScalarAggregatorImpl() override { - if (_Py_IsFinalizing()) { + if (Py_IsFinalizing()) { function->detach(); } } @@ -270,7 +270,7 @@ }; ~PythonUdfHashAggregatorImpl() override { - if (_Py_IsFinalizing()) { + if (Py_IsFinalizing()) { function->detach(); } }