Skip to content

ENH/API: errors argument for ExtensionArray.astype #36151

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

Closed
dsaxton opened this issue Sep 5, 2020 · 3 comments
Closed

ENH/API: errors argument for ExtensionArray.astype #36151

dsaxton opened this issue Sep 5, 2020 · 3 comments
Labels
API - Consistency Internal Consistency of API/Behavior Dtype Conversions Unexpected or buggy dtype conversions Enhancement ExtensionArray Extending pandas with custom dtypes or arrays.

Comments

@dsaxton
Copy link
Member

dsaxton commented Sep 5, 2020

Series.astype and DataFrame.astype both allow control over whether the original object should be returned on errors in conversion by setting the errors argument to either "ignore" or "raise". Should ExtensionArray.astype also allow this?

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.astype.html
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.astype.html

xref #35979

@dsaxton dsaxton added Enhancement Dtype Conversions Unexpected or buggy dtype conversions ExtensionArray Extending pandas with custom dtypes or arrays. API - Consistency Internal Consistency of API/Behavior labels Sep 5, 2020
@jorisvandenbossche
Copy link
Member

Personally I would keep this ability on the Series/DataFrame level, and not complicate the ExtensionArray interface with it.

@jbrockmendel
Copy link
Member

I agree with @jorisvandenbossche on this one.

@dsaxton
Copy link
Member Author

dsaxton commented Oct 12, 2020

I think not overcomplicating makes sense

@dsaxton dsaxton closed this as completed Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior Dtype Conversions Unexpected or buggy dtype conversions Enhancement ExtensionArray Extending pandas with custom dtypes or arrays.
Projects
None yet
Development

No branches or pull requests

3 participants