Forward kwargs from cat_ranges to cat_file (#2016)#2044
Merged
martindurant merged 1 commit intoJun 8, 2026
Conversation
AbstractFileSystem.cat_ranges accepts **kwargs but dropped them when calling cat_file, so parameters such as a cache's block_size were silently ignored and every range read bypassed the cache. The async AsyncFileSystem._cat_ranges already forwards them. Pass **kwargs through to cat_file, matching the async implementation. Fixes fsspec#2016
Member
|
Thank you! |
|
Thanks from me too!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2016.
AbstractFileSystem.cat_rangesaccepts**kwargsbut did not forward them when callingcat_file:As reported, this means parameters such as a cache's
block_sizeare lost, socat_rangesbypasses an on-disk cache and goes out to the underlying (remote) filesystem on every call. The asyncAsyncFileSystem._cat_rangesalready forwards**kwargsto_cat_file, so this just brings the sync path in line.@martindurant confirmed in the issue: "I'd be happy to see kwargs passed through as you suggest for part 1 of this issue." This PR is scoped to that part 1.
Change
Test plan
test_cat_ranges_forwards_kwargsinfsspec/tests/test_spec.py(a recording filesystem asserts the kwarg reachescat_file).pytest fsspec/tests/test_spec.py— 120 passed.ruff check/ruff format --check— clean.