From e55744cae28cd25bc92a0c9b2febe19b717bcf72 Mon Sep 17 00:00:00 2001 From: MarcoGorelli <> Date: Wed, 19 Apr 2023 11:12:30 +0100 Subject: [PATCH 1/3] make get_rows take a column --- .../dataframe_api/dataframe_object.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index 45269423..5af67534 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -88,24 +88,18 @@ def get_columns_by_name(self, names: Sequence[str], /) -> DataFrame: """ ... - def get_rows(self, indices: Sequence[int]) -> DataFrame: + def get_rows(self, indices: Column[int]) -> DataFrame: """ Select a subset of rows, similar to `ndarray.take`. Parameters ---------- - indices : Sequence[int] + indices : Column Positions of rows to select. Returns ------- DataFrame - - Notes - ----- - Some discussion participants prefer a stricter type Column[int] for - indices in order to make it easier to implement in a performant manner - on GPUs. """ ... From da11ff4452bfd8662f3b77fba1283b01de4a3e5e Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Wed, 19 Apr 2023 18:34:09 +0100 Subject: [PATCH 2/3] Update spec/API_specification/dataframe_api/dataframe_object.py --- spec/API_specification/dataframe_api/dataframe_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index 5af67534..48fddef5 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -88,7 +88,7 @@ def get_columns_by_name(self, names: Sequence[str], /) -> DataFrame: """ ... - def get_rows(self, indices: Column[int]) -> DataFrame: + def get_rows(self, indices: "Column[int]") -> DataFrame: """ Select a subset of rows, similar to `ndarray.take`. From 581167101bde23ee44378fac01b015c759fc2fbc Mon Sep 17 00:00:00 2001 From: Marco Edward Gorelli <33491632+MarcoGorelli@users.noreply.github.com> Date: Wed, 19 Apr 2023 18:34:24 +0100 Subject: [PATCH 3/3] Update spec/API_specification/dataframe_api/dataframe_object.py --- spec/API_specification/dataframe_api/dataframe_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/API_specification/dataframe_api/dataframe_object.py b/spec/API_specification/dataframe_api/dataframe_object.py index 48fddef5..c48464b7 100644 --- a/spec/API_specification/dataframe_api/dataframe_object.py +++ b/spec/API_specification/dataframe_api/dataframe_object.py @@ -94,7 +94,7 @@ def get_rows(self, indices: "Column[int]") -> DataFrame: Parameters ---------- - indices : Column + indices : Column[int] Positions of rows to select. Returns