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

ENH: add from_dataframe and DataFrame #331

Merged
merged 2 commits into from
Sep 29, 2022

Conversation

bashtage
Copy link
Contributor

@bashtage bashtage mentioned this pull request Sep 27, 2022
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.

Unclear to me whether we should add tests for this? Other comments are related to checking the API definition at https://data-apis.org/dataframe-protocol/latest/API.html, which may reveal that we have issues in the pandas source in how this is typed.

@abstractmethod
def __dlpack__(self): ...
@abstractmethod
def __dlpack_device__(self) -> tuple[DlpackDeviceType, int | None]: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking at https://data-apis.org/dataframe-protocol/latest/API.html, I don't think the second element of the tuple can be None

Copy link
Contributor Author

@bashtage bashtage Sep 27, 2022

Choose a reason for hiding this comment

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

class Column(ABC, metaclass=abc.ABCMeta):
@property
@abstractmethod
def size(self) -> int: ...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the spec type might also be wrong here. The text indicates that the size is required, either the full DF size or the chunk size if a single chunk.

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 @bashtage

@Dr-Irv Dr-Irv merged commit a560754 into pandas-dev:main Sep 29, 2022
@bashtage bashtage deleted the add-from-dataframe branch September 30, 2022 17:42
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