Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions fsspec/caching.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,14 +345,17 @@ def _read_cache(

else:
# read from the initial
out = []
out.append(self._fetch_block_cached(start_block_number)[start_pos:])
out = [self._fetch_block_cached(start_block_number)[start_pos:]]

# intermediate blocks
# Note: it'd be nice to combine these into one big request. However
# that doesn't play nicely with our LRU cache.
for block_number in range(start_block_number + 1, end_block_number):
out.append(self._fetch_block_cached(block_number))
out.extend(
map(
self._fetch_block_cached,
range(start_block_number + 1, end_block_number),
)
)

# final block
out.append(self._fetch_block_cached(end_block_number)[:end_pos])
Expand Down Expand Up @@ -821,14 +824,17 @@ def _read_cache(

else:
# read from the initial
out = []
out.append(self._fetch_block_cached(start_block_number)[start_pos:])
out = [self._fetch_block_cached(start_block_number)[start_pos:]]

# intermediate blocks
# Note: it'd be nice to combine these into one big request. However
# that doesn't play nicely with our LRU cache.
for block_number in range(start_block_number + 1, end_block_number):
out.append(self._fetch_block_cached(block_number))
out.extend(
map(
self._fetch_block_cached,
range(start_block_number + 1, end_block_number),
)
)

# final block
out.append(self._fetch_block_cached(end_block_number)[:end_pos])
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ ignore = [
# Fix these codes later
"G004",
"PERF203",
"PERF401",
]

[tool.pytest.ini_options]
Expand Down