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

GH-37145: [Python] support boolean columns with bitsize 1 in from_dataframe #37975

Merged

Conversation

AlenkaF
Copy link
Member

@AlenkaF AlenkaF commented Oct 2, 2023

Rationale for this change

Bit-packed booleans are currently not supported in the from_dataframe of the Dataframe Interchange Protocol.

Note: We currently represent booleans in the pyarrow implementation as uint8 which will also need to be changed in a follow-up PR (see data-apis/dataframe-api#227).

What changes are included in this PR?

This PR adds the support for bit-packed booleans when consuming a dataframe interchange object.

Are these changes tested?

Only locally, currently!

@AlenkaF AlenkaF force-pushed the gh-37145-bit-packed-boolean-from_dataframe branch from cb49384 to 17efcb9 Compare October 3, 2023 09:33
@AlenkaF AlenkaF marked this pull request as ready for review October 3, 2023 10:53
@jorisvandenbossche
Copy link
Member

Implementation looks good, just needs some tests then (I assume the problem here is that we ourselves don't generate this (yet), so we can't actually test it easily?)

@AlenkaF
Copy link
Member Author

AlenkaF commented Oct 3, 2023

Implementation looks good, just needs some tests then (I assume the problem here is that we ourselves don't generate this (yet), so we can't actually test it easily?)

Yeah 😬 I think the only other library that will use bit-packed booleans is Polars.

I guess this PR should stay draft until we generate this ourselves?

@jorisvandenbossche
Copy link
Member

Maybe we can also merge this, if you can test it locally with polars, and then open an issue to remind ourselves to add tests for it later (or when we export such data ourselves).

Merging this sooner rather than later would be good, as otherwise it breaks polars->pyarrow conversion

@AlenkaF
Copy link
Member Author

AlenkaF commented Oct 3, 2023

OK, I will test one more time and then ping you for merge (or I can do it, if that is OK).

I plan to create an issue for us to export bit-packed boolean data so we can discuss what would be the correct approach. I will add the note about the tests there.

@AlenkaF
Copy link
Member Author

AlenkaF commented Oct 4, 2023

Tested the code from the original report:

Screenshot 2023-10-04 at 15 06 36

We can marge.

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Thanks for testing!

@AlenkaF AlenkaF merged commit 161510e into apache:main Oct 5, 2023
@AlenkaF AlenkaF removed the awaiting review Awaiting review label Oct 5, 2023
@AlenkaF AlenkaF deleted the gh-37145-bit-packed-boolean-from_dataframe branch October 5, 2023 15:16
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit 161510e.

There were 3 benchmark results indicating a performance regression:

The full Conbench report has more details. It also includes information about 3 possible false positives for unstable benchmarks that are known to sometimes produce them.

JerAguilon pushed a commit to JerAguilon/arrow that referenced this pull request Oct 23, 2023
…om_dataframe (apache#37975)

### Rationale for this change

Bit-packed booleans are currently not supported in the `from_dataframe` of the Dataframe Interchange Protocol.

Note: We currently represent booleans in the pyarrow implementation as `uint8` which will also need to be changed in a follow-up PR (see data-apis/dataframe-api#227). 

### What changes are included in this PR?

This PR adds the support for bit-packed booleans when consuming a dataframe interchange object.

### Are these changes tested?

Only locally, currently!
* Closes: apache#37145

Lead-authored-by: AlenkaF <[email protected]>
Co-authored-by: Alenka Frim <[email protected]>
Signed-off-by: AlenkaF <[email protected]>
loicalleyne pushed a commit to loicalleyne/arrow that referenced this pull request Nov 13, 2023
…om_dataframe (apache#37975)

### Rationale for this change

Bit-packed booleans are currently not supported in the `from_dataframe` of the Dataframe Interchange Protocol.

Note: We currently represent booleans in the pyarrow implementation as `uint8` which will also need to be changed in a follow-up PR (see data-apis/dataframe-api#227). 

### What changes are included in this PR?

This PR adds the support for bit-packed booleans when consuming a dataframe interchange object.

### Are these changes tested?

Only locally, currently!
* Closes: apache#37145

Lead-authored-by: AlenkaF <[email protected]>
Co-authored-by: Alenka Frim <[email protected]>
Signed-off-by: AlenkaF <[email protected]>
dgreiss pushed a commit to dgreiss/arrow that referenced this pull request Feb 19, 2024
…om_dataframe (apache#37975)

### Rationale for this change

Bit-packed booleans are currently not supported in the `from_dataframe` of the Dataframe Interchange Protocol.

Note: We currently represent booleans in the pyarrow implementation as `uint8` which will also need to be changed in a follow-up PR (see data-apis/dataframe-api#227). 

### What changes are included in this PR?

This PR adds the support for bit-packed booleans when consuming a dataframe interchange object.

### Are these changes tested?

Only locally, currently!
* Closes: apache#37145

Lead-authored-by: AlenkaF <[email protected]>
Co-authored-by: Alenka Frim <[email protected]>
Signed-off-by: AlenkaF <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Python] support boolean columns with bitsize 1 in from_dataframe
2 participants