Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Interface for converting pandas ExtensionArray / other custom array objects to pyarrow Array #21741

Closed
asfimport opened this issue May 6, 2019 · 1 comment

Comments

@asfimport
Copy link
Collaborator

asfimport commented May 6, 2019

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 pandas-dev/pandas#20612 for an issue discussing this on the pandas side.

Reporter: Joris Van den Bossche / @jorisvandenbossche

Related issues:

Note: This issue was originally created as ARROW-5271. Please see the migration documentation for further details.

@asfimport
Copy link
Collaborator Author

Joris Van den Bossche / @jorisvandenbossche:
I am going to close this issue in favor of the earlier identical issue ARROW-3829. And I also opened a PR for this: #5106

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant