mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 16:47:19 +08:00
Harden default cast options, fix unsafe Python case
Change-Id: I0ec8aa206d1bef3fce3f8fe7239c255bffd3f660
This commit is contained in:
1 parent
1d07b75626
commit
34f5c9d17b
2 files changed
+4
-2
No files matched your search
@@ -33,6 +33,8 @@ class FunctionContext;
|
||||
class UnaryKernel;
|
||||
|
||||
struct CastOptions {
|
||||
CastOptions() : allow_int_overflow(false) {}
|
||||
|
||||
bool allow_int_overflow;
|
||||
};
|
||||
|
||||
|
||||
@@ -131,8 +131,8 @@ cdef class Array:
|
||||
CCastOptions options
|
||||
shared_ptr[CArray] result
|
||||
|
||||
if safe:
|
||||
options.allow_int_overflow = 0
|
||||
if not safe:
|
||||
options.allow_int_overflow = 1
|
||||
|
||||
with nogil:
|
||||
check_status(Cast(_context(), self.ap[0], target_type.sp_type,
|
||||
|
||||
Reference in new issue
Block a user