Skip to content

ENH: fix arrow roundtrip for ExtensionDtypes in absence of pandas metadata #34275

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

Merged

Conversation

jorisvandenbossche
Copy link
Member

An oversight in our Arrow Extension Types for period and interval to also define the conversion to the equivalent pandas dtype. This ensures that the arrow->pandas conversion also works if there is no "pandas_metadata" in the schema's metadata, eg when this metadata was lost during some operations (up to now, the pandas ExtensionDtype was reconstructed based on the string name in the stored metadata).

See https://arrow.apache.org/docs/python/extending_types.html#conversion-to-pandas

@jorisvandenbossche jorisvandenbossche added the IO Parquet parquet, feather label May 20, 2020
@jorisvandenbossche jorisvandenbossche added this to the 1.1 milestone May 20, 2020
@jreback
Copy link
Contributor

jreback commented May 20, 2020

lgtm. do we need a whatsnew note?

@jorisvandenbossche
Copy link
Member Author

A whatsnew note for it might be a bit "obscure", but can certainly add one if preferred

@jorisvandenbossche jorisvandenbossche merged commit a9ad632 into pandas-dev:master May 22, 2020
@jorisvandenbossche jorisvandenbossche deleted the pyarrow-EA-roundtrip branch May 22, 2020 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO Parquet parquet, feather
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants