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

FileSystem: handle encoding via kwargs. #7694

Merged
merged 1 commit into from May 5, 2022
Merged

FileSystem: handle encoding via kwargs. #7694

merged 1 commit into from May 5, 2022

Conversation

daavoo
Copy link
Contributor

@daavoo daavoo commented May 4, 2022

Closes #7691

@daavoo daavoo requested a review from a team as a code owner May 4, 2022 07:37
@daavoo daavoo requested a review from pared May 4, 2022 07:37
@daavoo daavoo marked this pull request as draft May 4, 2022 07:44
@daavoo daavoo force-pushed the base-fs-encoding branch 2 times, most recently from 21e6bca to 50a7f76 Compare May 4, 2022 08:20
@daavoo daavoo marked this pull request as ready for review May 4, 2022 08:20
@daavoo daavoo requested review from efiop and removed request for pared May 4, 2022 08:20
@skshetry skshetry self-requested a review May 4, 2022 08:26
@daavoo daavoo self-assigned this May 4, 2022
@daavoo daavoo marked this pull request as draft May 4, 2022 12:20
Copy link
Contributor Author

@daavoo daavoo left a comment

Choose a reason for hiding this comment

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

Need to also update DVCFs and RepoFS

dvc/fs/base.py Outdated Show resolved Hide resolved
@daavoo daavoo marked this pull request as ready for review May 4, 2022 14:37
@skshetry skshetry added bugfix fixes bug fs: http Related to the HTTP filesystem labels May 4, 2022
@efiop efiop changed the title FileSystem: Handle encoding via kwargs. FileSystem: handle encoding via kwargs. May 4, 2022
Comment on lines +184 to +185
if "b" in mode:
kwargs.pop("encoding", None)
Copy link
Member

Choose a reason for hiding this comment

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

Hm, why do we even need to pop it? In the #7691 we are not even getting the encoding here.

Copy link
Member

Choose a reason for hiding this comment

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

RepoFS and DvcFS always sends encoding=None to the filesystems even in binary mode. open() is not fsspec compliant and can be fixed at that time in other filesystems. For now, I think this is the simplest approach.

Copy link
Member

Choose a reason for hiding this comment

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

Let's fix repofs/dvcfs then if that is not too much work. Seems like it is a simple arg adjustment. Unless I'm missing something.

Copy link
Member

@skshetry skshetry May 5, 2022

Choose a reason for hiding this comment

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

I'd still try to avoid this bug here even if we fix repofs/dvcfs, until we fix this on fsspec's side.

@efiop efiop merged commit 9bd9ac4 into main May 5, 2022
@efiop efiop deleted the base-fs-encoding branch May 5, 2022 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix fixes bug fs: http Related to the HTTP filesystem
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

plots: http remote fails to open an existing file
4 participants