diff --git a/protocol/dataframe_protocol.py b/protocol/dataframe_protocol.py index e918e1e4..f17b43ea 100644 --- a/protocol/dataframe_protocol.py +++ b/protocol/dataframe_protocol.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from abc import ( ABC, abstractmethod, @@ -476,6 +478,28 @@ def select_columns_by_name(self, names: Sequence[str]) -> "DataFrame": """ pass + @abstractmethod + def slice_rows( + self, + offset: int, + size: int | None, + ) -> DataFrame: + """ + Select a subset of rows corresponding to a slice. + + Parameters + ---------- + offset : int + Row offset to start slice at. + size : int or None + Number of rows of the resulting slice. If None, slice to end of DataFrame. + + Returns + ------- + DataFrame + """ + pass + @abstractmethod def get_chunks(self, n_chunks: Optional[int] = None) -> Iterable["DataFrame"]: """