Skip to content

Commit

Permalink
Merge pull request #2951 from activeloopai/fix_partial_read
Browse files Browse the repository at this point in the history
Fix partial read
  • Loading branch information
activesoull authored Sep 12, 2024
2 parents ac320b6 + 74d3117 commit a4168a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deeplake/core/partial_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ def __getitem__(self, slice_: slice) -> memoryview:
assert start is not None and stop is not None
assert step is None or step == 1
slice_tuple = (start, stop)

if start == stop:
return memoryview(b"")
if slice_tuple not in self.data_fetched:
self.data_fetched[slice_tuple] = memoryview(
self.cache.get_bytes(self.path, start, stop)
Expand Down

0 comments on commit a4168a8

Please sign in to comment.