Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[ArrowStringArray] fix test_astype_int, test_astype_float #41018
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
[ArrowStringArray] fix test_astype_int, test_astype_float #41018
Changes from 1 commit
683da0b
cd6edc9
c16e2ec
a0f7035
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
can you type here (followups are ok)
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.
I don't think we should use this method like this:
__from_arrow__
is meant to convert data from arrow for that specific dtype, and doesn't necessarily need to include any casting logic (I think)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.
Alternative logic could be something like:
that would specifically work for the numeric masked arrays, and not rely on
__from_arrow__
to do the casting (but rely on pyarrow for that).This would already support casting to nullable integer / float to get the tests passing.
An example why we can rely in general on
__from_arrow__
is eg if we would do herestring_array.astype(pd.PeriodDtype("D"))
, which would fail in ``from_arrowThere 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.
indeed, we have a similar with StringArray as well #40566 where
in many cases fails as _from_sequence, like __from_arrow__, does not support casting in many cases.
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.
prob best in a dedicate _errors test
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.
sure. done in simonjayhawkins@e1577d4
will open a PR with other follow-ups