From af427811c9696c6e1fd3b781cc2f8c31f6ac5e8b Mon Sep 17 00:00:00 2001 From: Lars Reimann Date: Tue, 30 Apr 2024 22:42:23 +0200 Subject: [PATCH] feat: rename `group_rows_by` in `Table` to `group_rows` --- src/safeds/data/tabular/containers/_table.py | 2 +- .../_table/{test_group_rows_by.py => test_group_rows.py} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename tests/safeds/data/tabular/containers/_table/{test_group_rows_by.py => test_group_rows.py} (96%) diff --git a/src/safeds/data/tabular/containers/_table.py b/src/safeds/data/tabular/containers/_table.py index 672cfaa2b..9de33b52a 100644 --- a/src/safeds/data/tabular/containers/_table.py +++ b/src/safeds/data/tabular/containers/_table.py @@ -1153,7 +1153,7 @@ def filter_rows(self, query: Callable[[Row], bool]) -> Table: _T = TypeVar("_T") - def group_rows_by(self, key_selector: Callable[[Row], _T]) -> dict[_T, Table]: + def group_rows(self, key_selector: Callable[[Row], _T]) -> dict[_T, Table]: """ Return a dictionary with copies of the output tables as values and the keys from the key_selector. diff --git a/tests/safeds/data/tabular/containers/_table/test_group_rows_by.py b/tests/safeds/data/tabular/containers/_table/test_group_rows.py similarity index 96% rename from tests/safeds/data/tabular/containers/_table/test_group_rows_by.py rename to tests/safeds/data/tabular/containers/_table/test_group_rows.py index 2fb88a8f3..4fc766d7a 100644 --- a/tests/safeds/data/tabular/containers/_table/test_group_rows_by.py +++ b/tests/safeds/data/tabular/containers/_table/test_group_rows.py @@ -31,5 +31,5 @@ ids=["select by row1", "different types in column", "empty table", "table with no rows"], ) def test_should_group_rows(table: Table, selector: Callable, expected: dict) -> None: - out = table.group_rows_by(selector) + out = table.group_rows(selector) assert out == expected