[
https://issues.apache.org/jira/browse/ARROW-6176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Wes McKinney resolved ARROW-6176.
---------------------------------
Fix Version/s: (was: 1.0.0)
0.17.0
Resolution: Fixed
Issue resolved by pull request 6653
[https://github.com/apache/arrow/pull/6653]
> [Python] Allow to subclass ExtensionArray to attach to custom extension type
> ----------------------------------------------------------------------------
>
> Key: ARROW-6176
> URL: https://issues.apache.org/jira/browse/ARROW-6176
> Project: Apache Arrow
> Issue Type: Improvement
> Components: Python
> Reporter: Joris Van den Bossche
> Assignee: Paul Balanca
> Priority: Major
> Labels: pull-request-available
> Fix For: 0.17.0
>
> Time Spent: 4h 50m
> Remaining Estimate: 0h
>
> Currently, you can define a custom extension type in Python with
> {code}
> class UuidType(pa.ExtensionType):
> def __init__(self):
> pa.ExtensionType.__init__(self, pa.binary(16))
> def __reduce__(self):
> return UuidType, ()
> {code}
> but the array you can create with this is always ExtensionArray. We should
> provide a way to define a subclass (eg `UuidArray` in this case) that can
> hold custom logic.
> For example, a user might want to define `UuidArray` such that `arr[i]`
> returns an instance of Python's `uuid.UUID`
> From https://github.com/apache/arrow/pull/4532#pullrequestreview-249396691
--
This message was sent by Atlassian Jira
(v8.3.4#803005)