-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: fix parquet roundtrip with unsigned integer dtypes #31918
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
BUG: fix parquet roundtrip with unsigned integer dtypes #31918
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov failure can be ignored I think.
thanks @jorisvandenbossche |
@meeseeksdev backport to 1.0.x |
…d integer dtypes
…dtypes (#31928) Co-authored-by: Joris Van den Bossche <[email protected]>
@@ -103,6 +103,10 @@ def __from_arrow__( | |||
import pyarrow # noqa: F811 | |||
from pandas.core.arrays._arrow_utils import pyarrow_array_to_numpy_and_mask | |||
|
|||
pyarrow_type = pyarrow.from_numpy_dtype(self.type) | |||
if not array.type.equals(pyarrow_type): | |||
array = array.cast(pyarrow_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the cause of a bunch of xfails in test_from_arrow_type_error. does this need to be tightened somehow, or is the test behavior not something we care about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could be tightened, for example by checking that the array.type
is integral
Closes #31896