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

BUG: respect allow_copy=False in interchange.from_dataframe #54322

Merged

Conversation

MarcoGorelli
Copy link
Member

@MarcoGorelli MarcoGorelli commented Jul 31, 2023

On main, the following doesn't raise:

import pyarrow as pa
import pyarrow.compute as pc

n_legs = pa.chunked_array([[2, 2, 4], [4, 5, 100]])
names = ["n_legs"]
table = pa.table([n_legs], names=names)

pd.api.interchange.from_dataframe(table, allow_copy=False)

Comment on lines +456 to +458
if length > 0:
return np.ctypeslib.as_array(data_pointer, shape=(length,))
return np.array([], dtype=ctypes_type)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated, but this silences a warning

@mroeschke mroeschke added the Interchange Dataframe Interchange Protocol label Jul 31, 2023
@mroeschke mroeschke added this to the 2.1 milestone Jul 31, 2023
@mroeschke mroeschke merged commit d1dd468 into pandas-dev:main Jul 31, 2023
35 of 36 checks passed
@mroeschke
Copy link
Member

Nice thanks @MarcoGorelli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interchange Dataframe Interchange Protocol
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants