Closed
Description
xref #25308 (comment)
When EAs go through cython routines, they need to be converted to numpy arrays (and dtypes) first and then recast to the correct EA. This recast may require specific logic. For example, DatetimeTZDtype
s need to be localized to UTC first before applying the dtype.
The proposal is for (optional) internal _serialize
and _from_serialized
methods that defines specific recasting logic for the EA. @jreback proposed something like:
serialized, dtype = EA._serialize()
original = EA._from_serialize(serialized, dtype)