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

__arrow_c_stream__ method on DataFrame #985

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

kylebarron
Copy link
Contributor

@kylebarron kylebarron commented Aug 22, 2024

Pandas added support for the Arrow PyCapsule Interface (the __arrow_c_stream__ method) in pandas v2.2. pandas-dev/pandas#56587

This method returns a C PyCapsule, so it's not the types of arguments or return value that matters, it's really just the existence of the method, so that when other libraries expect an object defined as

class ArrowStreamExportable(Protocol):
    def __arrow_c_stream__(
        self,
        requested_schema: object | None = None
    ) -> object:
        ...

then a DataFrame will satisfy the type checker

  • Closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added: Please use assert_type() to assert the type of any return value

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

Thanks @kylebarron

I'm not sure we would have ever picked this up, because it isn't documented in the pandas release notes.

@Dr-Irv Dr-Irv merged commit d2798db into pandas-dev:main Aug 26, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants