diff --git a/fsspec/asyn.py b/fsspec/asyn.py index 4ac1419f0..279aae1af 100644 --- a/fsspec/asyn.py +++ b/fsspec/asyn.py @@ -467,6 +467,16 @@ async def _cat_ranges( on_error="return", **kwargs, ): + """Get the contents of byte ranges from one or more files + + Parameters + ---------- + paths: list + A list of of filepaths on this filesystems + starts, ends: int or list + Bytes limits of the read. If using a single int, the same value will be + used to read all the specified files. + """ # TODO: on_error if max_gap is not None: # use utils.merge_offset_ranges @@ -476,7 +486,7 @@ async def _cat_ranges( if not isinstance(starts, Iterable): starts = [starts] * len(paths) if not isinstance(ends, Iterable): - ends = [starts] * len(paths) + ends = [ends] * len(paths) if len(starts) != len(paths) or len(ends) != len(paths): raise ValueError coros = [ diff --git a/fsspec/spec.py b/fsspec/spec.py index 4ab3b7ee3..d7824c24e 100644 --- a/fsspec/spec.py +++ b/fsspec/spec.py @@ -828,6 +828,16 @@ def pipe(self, path, value=None, **kwargs): def cat_ranges( self, paths, starts, ends, max_gap=None, on_error="return", **kwargs ): + """Get the contents of byte ranges from one or more files + + Parameters + ---------- + paths: list + A list of of filepaths on this filesystems + starts, ends: int or list + Bytes limits of the read. If using a single int, the same value will be + used to read all the specified files. + """ if max_gap is not None: raise NotImplementedError if not isinstance(paths, list): @@ -835,7 +845,7 @@ def cat_ranges( if not isinstance(starts, list): starts = [starts] * len(paths) if not isinstance(ends, list): - ends = [starts] * len(paths) + ends = [ends] * len(paths) if len(starts) != len(paths) or len(ends) != len(paths): raise ValueError out = []