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

Handle pyarrow-backed columns in pandas 2 DataFrames #3128

Merged
merged 6 commits into from
Jul 30, 2023
Merged

Conversation

jonmmease
Copy link
Contributor

closes #3127

pandas 2.0 introduced optional pyarrow dtype integration (See https://pandas.pydata.org/docs/user_guide/pyarrow.html). Altair's DataFrame sanitization logic was broken in two ways for these DataFrames.

  1. The numpy np.issubdtype function raises an exception when passed a pyarrow dtype (rather than just return False).
  2. The name of the timestamp DataType starts with "timestamp" rather than "datetime" as for regular pandas dtypes.

This PR adds a previously failing test case and handles these two issues.

@mattijn
Copy link
Contributor

mattijn commented Jul 30, 2023

Based on review in #3127 will merge this. Thanks again @jonmmease and @sacundim!

@mattijn mattijn merged commit d32d053 into main Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pandas 2.0 with pyarrow backend: "TypeError: Cannot interpret 'timestamp[ms][pyarrow]' as a data type"
2 participants