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 b0317f2b2b GH-43707: [Python] Fix compilation on Cython<3 (#43765)
b0317f2b2b is described below

commit b0317f2b2b62b3be9beb8d834aa51b776fb0179e
Author: David Li <[email protected]>
AuthorDate: Tue Aug 20 17:04:33 2024 +0900

    GH-43707: [Python] Fix compilation on Cython<3 (#43765)
    
    ### Rationale for this change
    
    Fix compilation on Cython < 3
    
    ### What changes are included in this PR?
    
    Add an explicit cast
    
    ### Are these changes tested?
    
    N/A
    
    ### Are there any user-facing changes?
    
    No
    * GitHub Issue: #43707
    
    Authored-by: David Li <[email protected]>
    Signed-off-by: Joris Van den Bossche <[email protected]>
---
 python/pyarrow/types.pxi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/python/pyarrow/types.pxi b/python/pyarrow/types.pxi
index 93d68fb847..dcd2b61c33 100644
--- a/python/pyarrow/types.pxi
+++ b/python/pyarrow/types.pxi
@@ -5328,8 +5328,9 @@ def opaque(DataType storage_type, str type_name not None, 
str vendor_name not No
     cdef:
         c_string c_type_name = tobytes(type_name)
         c_string c_vendor_name = tobytes(vendor_name)
-        shared_ptr[CDataType] c_type = make_shared[COpaqueType](
+        shared_ptr[COpaqueType] c_opaque_type = make_shared[COpaqueType](
             storage_type.sp_type, c_type_name, c_vendor_name)
+        shared_ptr[CDataType] c_type = static_pointer_cast[CDataType, 
COpaqueType](c_opaque_type)
         OpaqueType out = OpaqueType.__new__(OpaqueType)
     out.init(c_type)
     return out

Reply via email to