Skip to content

Commit

Permalink
apacheGH-43707: [Python] Fix compilation on Cython<3 (apache#43765)
Browse files Browse the repository at this point in the history
### 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: apache#43707

Authored-by: David Li <li.davidm96@gmail.com>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
  • Loading branch information
lidavidm authored Aug 20, 2024
1 parent 70a0189 commit b0317f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/pyarrow/types.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b0317f2

Please sign in to comment.