Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
Description
We already support casting an extension array to its storage type (ARROW-7858):
>>> from pyarrow.tests.test_extension_type import IntegerType >>> arr = pa.array([1, 2, 3], pa.int64()) >>> arr_ext = pa.ExtensionArray.from_storage(IntegerType(), arr) >>> arr_ext.cast(arr.type) Out[29]: <pyarrow.lib.Int64Array object at 0x7f7b0d4739a0> [ 1, 2, 3 ]
but we don't support the cast the other way around from storage type to extension type:
>>> arr.cast(arr_ext.type) ... ArrowNotImplementedError: Unsupported cast from int64 to extension<arrow.py_extension_type<IntegerType>> (no available cast function for target type) ../src/arrow/compute/cast.cc:119 GetCastFunctionInternal(cast_options->to_type, args[0].type().get())
Attachments
Issue Links
- is related to
-
ARROW-7858 [C++][Python] Support casting an Extension type to its storage type
- Resolved
-
ARROW-15545 [C++] Cast dictionary of extension type to extension type
- Resolved
- links to