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

fix(python): Correctly use read_parquet for all binary inputs #13218

Merged
merged 2 commits into from
Dec 23, 2023

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Dec 23, 2023

Closes #13099

@github-actions github-actions bot added fix Bug fix python Related to Python Polars labels Dec 23, 2023
@@ -145,7 +145,7 @@ def read_parquet(
)

# Read binary types using `read_parquet`
elif isinstance(source, (BinaryIO, BytesIO, bytes)):
elif isinstance(source, (io.BufferedIOBase, io.RawIOBase, bytes)):
Copy link
Member Author

Choose a reason for hiding this comment

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

This was the culprit - it didn't catch files opened in binary mode.

Copy link
Member

Choose a reason for hiding this comment

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

Alright. Nice to have it covered in tests now. :) Would have never seen that in a review. :D

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah this stuff is mighty confusing with the type hints vs the objects and everything named similarly.

I'm definitely doing more refactoring around the IO functions soon, lots of improvements to be made here.

@ritchie46 ritchie46 merged commit bb00812 into main Dec 23, 2023
14 checks passed
@ritchie46 ritchie46 deleted the read-parquet branch December 23, 2023 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

read_parquet binary not working any more (since 0.20.0)
2 participants