Skip to content

Commit 069e45b

Browse files
committed
add slice_rows to interchange protocol
1 parent c5f0835 commit 069e45b

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

protocol/dataframe_protocol.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from abc import (
24
ABC,
35
abstractmethod,
@@ -476,6 +478,31 @@ def select_columns_by_name(self, names: Sequence[str]) -> "DataFrame":
476478
"""
477479
pass
478480

481+
@abstractmethod
482+
def slice_rows(
483+
self,
484+
start: int | None = None,
485+
stop: int | None = None,
486+
step: int | None = None,
487+
) -> DataFrame:
488+
"""
489+
Select a subset of rows corresponding to a slice.
490+
491+
Parameters
492+
----------
493+
start : int or None
494+
If None, starts at 0.
495+
stop : int or None
496+
If None, stops at the end.
497+
step : int or None
498+
If None, uses the default step of 1.
499+
500+
Returns
501+
-------
502+
DataFrame
503+
"""
504+
pass
505+
479506
@abstractmethod
480507
def get_chunks(self, n_chunks: Optional[int] = None) -> Iterable["DataFrame"]:
481508
"""

0 commit comments

Comments
 (0)