This is an automated email from the ASF dual-hosted git repository.
jorisvandenbossche pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 2bd8e06b48 GH-38857: [Python] Fix append mode for cython 2 (#39027)
2bd8e06b48 is described below
commit 2bd8e06b4867acea3dc5479e991998672804e8ea
Author: Joris Van den Bossche <[email protected]>
AuthorDate: Fri Dec 1 14:48:32 2023 +0100
GH-38857: [Python] Fix append mode for cython 2 (#39027)
### Rationale for this change
Small fixup of the change in https://github.com/apache/arrow/pull/38820 to
fix the build failure on cython 2 (nightly crossbow build)
* Closes: #38857
Authored-by: Joris Van den Bossche <[email protected]>
Signed-off-by: Joris Van den Bossche <[email protected]>
---
python/pyarrow/includes/libarrow.pxd | 3 ++-
python/pyarrow/io.pxi | 4 +++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/python/pyarrow/includes/libarrow.pxd
b/python/pyarrow/includes/libarrow.pxd
index 59b63b5fb7..b0b89f8614 100644
--- a/python/pyarrow/includes/libarrow.pxd
+++ b/python/pyarrow/includes/libarrow.pxd
@@ -1386,7 +1386,8 @@ cdef extern from "arrow/io/api.h" namespace "arrow::io"
nogil:
CResult[shared_ptr[COutputStream]] Open(const c_string& path)
@staticmethod
- CResult[shared_ptr[COutputStream]] Open(const c_string& path, c_bool
append)
+ CResult[shared_ptr[COutputStream]] OpenWithAppend" Open"(
+ const c_string& path, c_bool append)
int file_descriptor()
diff --git a/python/pyarrow/io.pxi b/python/pyarrow/io.pxi
index 3086845efa..6f39166401 100644
--- a/python/pyarrow/io.pxi
+++ b/python/pyarrow/io.pxi
@@ -1167,7 +1167,9 @@ cdef class OSFile(NativeFile):
cdef _open_writable(self, c_string path, c_bool append=False):
with nogil:
- self.output_stream = GetResultValue(FileOutputStream.Open(path,
append))
+ self.output_stream = GetResultValue(
+ FileOutputStream.OpenWithAppend(path, append)
+ )
self.is_writable = True
self._is_appending = append