pyarrow.compute.CastOptions#

classpyarrow.compute.CastOptions(target_type=None,*,allow_int_overflow=None,allow_time_truncate=None,allow_time_overflow=None,allow_decimal_truncate=None,allow_float_truncate=None,allow_invalid_utf8=None)#

Bases:_CastOptions

Options for thecast function.

Parameters:
target_typeDataType, optional

The PyArrow type to cast to.

allow_int_overflowbool, defaultFalse

Whether integer overflow is allowed when casting.

allow_time_truncatebool, defaultFalse

Whether time precision truncation is allowed when casting.

allow_time_overflowbool, defaultFalse

Whether date/time range overflow is allowed when casting.

allow_decimal_truncatebool, defaultFalse

Whether decimal precision truncation is allowed when casting.

allow_float_truncatebool, defaultFalse

Whether floating-point precision truncation is allowed when casting.

allow_invalid_utf8bool, defaultFalse

Whether producing invalid utf8 data is allowed when casting.

__init__(self,target_type=None,*,allow_int_overflow=None,allow_time_truncate=None,allow_time_overflow=None,allow_decimal_truncate=None,allow_float_truncate=None,allow_invalid_utf8=None)#

Methods

__init__(self[, target_type, ...])

deserialize(buf)

Deserialize options for a function.

is_safe(self)

safe([target_type])

serialize(self)

unsafe([target_type])

Attributes

allow_decimal_truncate#
allow_float_truncate#
allow_int_overflow#
allow_invalid_utf8#
allow_time_overflow#
allow_time_truncate#
staticdeserialize(buf)#

Deserialize options for a function.

Parameters:
bufBuffer

The buffer containing the data to deserialize.

is_safe(self)#
staticsafe(target_type=None)#

”Create a CastOptions for a safe cast.

Parameters:
target_typeoptional

Target cast type for the safe cast.

serialize(self)#
staticunsafe(target_type=None)#

”Create a CastOptions for an unsafe cast.

Parameters:
target_typeoptional

Target cast type for the unsafe cast.