-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
BUG: PyArrow dtypes were not supported in the interchange protocol #57764
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
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9d6b21b
fix pyarrow interchange
MarcoGorelli 031d9aa
reduce diff
MarcoGorelli cec4b4d
reduce diff
MarcoGorelli a1f0c43
Merge remote-tracking branch 'upstream/main' into interchange-pyarrow
MarcoGorelli f041b58
Merge remote-tracking branch 'upstream/main' into interchange-pyarrow
MarcoGorelli 9adf45f
start simplifying
MarcoGorelli 080e54f
simplify, remove is_validity arg
MarcoGorelli 9344458
remove unnecessary branch
MarcoGorelli c2f5bfa
doc maybe_rechunk
MarcoGorelli e4531a0
mypy
MarcoGorelli 0d89d97
extra test
MarcoGorelli d85c904
mark _col unused, assert rechunking did not modify original df
MarcoGorelli f28e33c
Merge remote-tracking branch 'upstream/main' into interchange-pyarrow
MarcoGorelli db0f402
declare buffer: Buffer outside of if/else branch
MarcoGorelli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,13 +298,14 @@ def string_column_to_ndarray(col: Column) -> tuple[np.ndarray, Any]: | |
|
||
null_pos = None | ||
if null_kind in (ColumnNullType.USE_BITMASK, ColumnNullType.USE_BYTEMASK): | ||
assert buffers["validity"], "Validity buffers cannot be empty for masks" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this isn't true for pyarrow dtypes right? they use bitmasks, but their validity buffer can indeed be
|
||
valid_buff, valid_dtype = buffers["validity"] | ||
null_pos = buffer_to_ndarray( | ||
valid_buff, valid_dtype, offset=col.offset, length=col.size() | ||
) | ||
if sentinel_val == 0: | ||
null_pos = ~null_pos | ||
validity = buffers["validity"] | ||
if validity is not None: | ||
valid_buff, valid_dtype = validity | ||
null_pos = buffer_to_ndarray( | ||
WillAyd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
valid_buff, valid_dtype, offset=col.offset, length=col.size() | ||
) | ||
if sentinel_val == 0: | ||
null_pos = ~null_pos | ||
|
||
# Assemble the strings from the code units | ||
str_list: list[None | float | str] = [None] * col.size() | ||
|
@@ -516,6 +517,8 @@ def set_nulls( | |
np.ndarray or pd.Series | ||
Data with the nulls being set. | ||
""" | ||
if validity is None: | ||
return data | ||
null_kind, sentinel_val = col.describe_null | ||
null_pos = None | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.