Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
Description
Related to ARROW-2428, which describes the issue to convert back to an ExtensionArray in to_pandas.
To start supporting to convert custom ExtensionArrays (eg the nullable Int64Dtype in pandas, or the arrow-backed fletcher arrays, ...) to arrow Arrays (eg in pyarrow.array(..)), I think it would be good to define an interface or hook that external projects can implement and that pyarrow will call if available.
This would allow external projects to define how they can be converted to arrow arrays, without the need that pyarrow itself starts to gather a lot of special cased code for certain types (like pandas' nullable Int64).
This could similar to how numpy looks for the __array__ method, so we might call it __arrow_array__.
See also https://github.com/pandas-dev/pandas/issues/20612 for an issue discussing this on the pandas side.
Attachments
Issue Links
- blocks
-
ARROW-5379 [Python] support pandas' nullable Integer type in from_pandas
- Closed
- is duplicated by
-
ARROW-3829 [Python] Support protocols to extract Arrow objects from third-party classes
- Resolved
- is related to
-
ARROW-2428 [Python] Add API to map Arrow types (including extension types) to pandas ExtensionArray instances for to_pandas conversions
- Resolved