-
Notifications
You must be signed in to change notification settings - Fork 366
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
referencefs: add streaming _open support #1778
Conversation
666d9b5
to
a598a9e
Compare
fsspec/implementations/reference.py
Outdated
part_or_url, start0, end0 = self._cat_common(path) | ||
if isinstance(part_or_url, bytes): | ||
return io.BytesIO(part_or_url[start0:end0]) | ||
|
||
protocol, _ = split_protocol(part_or_url) | ||
if start0 is None and end0 is None: | ||
return self.fss[protocol]._open( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we could put these in ReferenceFile
, but I avoided adding unnecessary redirection. That does mean we will do _cat_common
twice if it ends up going to the ReferenceFile
. It does not look very critical, so I think that's acceptable(?).
That said, I don't have a strong opinion on this and can move it if deemed necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine. Maybe add a comment to say what it's doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a small comment. PTAL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks totally good to me.
There is apparently something being picked up by codespell.
The dask installation failure in the downstream
run would be fixed by removing dask-expr from the environment. Please do fix this.
The error in the s3fs might already be fixed, but is in any case due to a recent release of botocore and nothing to do with this PR.
fsspec/implementations/reference.py
Outdated
part_or_url, start0, end0 = self._cat_common(path) | ||
if isinstance(part_or_url, bytes): | ||
return io.BytesIO(part_or_url[start0:end0]) | ||
|
||
protocol, _ = split_protocol(part_or_url) | ||
if start0 is None and end0 is None: | ||
return self.fss[protocol]._open( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is fine. Maybe add a comment to say what it's doing.
a598a9e
to
4ed21b1
Compare
…fsspec < 2025.2.0 Following changes from fsspec/filesystem_spec#1778.
Closes #1771.