Skip to content

Commit

Permalink
add slice_rows to interchange protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Feb 13, 2024
1 parent c5f0835 commit 069e45b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions protocol/dataframe_protocol.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from abc import (
ABC,
abstractmethod,
Expand Down Expand Up @@ -476,6 +478,31 @@ def select_columns_by_name(self, names: Sequence[str]) -> "DataFrame":
"""
pass

@abstractmethod
def slice_rows(
self,
start: int | None = None,
stop: int | None = None,
step: int | None = None,
) -> DataFrame:
"""
Select a subset of rows corresponding to a slice.
Parameters
----------
start : int or None
If None, starts at 0.
stop : int or None
If None, stops at the end.
step : int or None
If None, uses the default step of 1.
Returns
-------
DataFrame
"""
pass

@abstractmethod
def get_chunks(self, n_chunks: Optional[int] = None) -> Iterable["DataFrame"]:
"""
Expand Down

0 comments on commit 069e45b

Please sign in to comment.