-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: interchange bitmasks not supported in interchange/from_dataframe.py #52824
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
Changes from 2 commits
d31a413
b8e350a
010b521
4eb53f2
64d9343
6d8f895
a891ad8
c1cb46e
0dfeb85
a952cfd
d0f5cd6
ec72f37
d8adf1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,6 +104,21 @@ def test_large_string_pyarrow(): | |
assert pa.Table.equals(pa.interchange.from_dataframe(result), table) | ||
|
||
|
||
def test_bitmasks_pyarrow(): | ||
# GH 52795 | ||
pa = pytest.importorskip("pyarrow", "11.0.0") | ||
|
||
arr = [3.3, None, 2.1] | ||
table = pa.table({"arr": arr}) | ||
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. Maybe also test with 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. good one, thanks! that one didn't really work to begin with, so I had to make some slight changes to get it to work |
||
exchange_df = table.__dataframe__() | ||
result = from_dataframe(exchange_df) | ||
expected = pd.DataFrame({"arr": [3.3, float("nan"), 2.1]}) | ||
tm.assert_frame_equal(result, expected) | ||
|
||
# check round-trip | ||
assert pa.Table.equals(pa.interchange.from_dataframe(result), table) | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"data", [int_data, uint_data, float_data, bool_data, datetime_data] | ||
) | ||
|
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.
looks like this entire function was "dead code" on arrival, https://app.codecov.io/gh/pandas-dev/pandas/blob/main/pandas/core/interchange/from_dataframe.py shows the whole thing as uncovered by tests
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.
Ah, so we actually did have a pure python version of this conversion .. (just not used)