-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/123-check-that-methods-of-table-…
…can-handle-an-empty-table' into 123-check-that-methods-of-table-can-handle-an-empty-table
- Loading branch information
Showing
5 changed files
with
123 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "safe-ds" | ||
version = "0.12.0" | ||
version = "0.13.0" | ||
description = "A user-friendly library for Data Science in Python." | ||
authors = ["Lars Reimann <[email protected]>"] | ||
license = "MIT" | ||
|
@@ -29,8 +29,8 @@ pytest-cov = "^4.0.0" | |
[tool.poetry.group.docs.dependencies] | ||
jupyter = "^1.0.0" | ||
mkdocs = "^1.4.2" | ||
mkdocstrings = ">=0.20,<0.22" | ||
mkdocstrings-python = ">=0.8.3,<0.10.0" | ||
mkdocstrings = ">=0.20,<0.23" | ||
mkdocstrings-python = ">=0.8.3,<1.2.0" | ||
mkdocs-autorefs = "^0.4.1" | ||
mkdocs-gen-files = ">=0.4,<0.6" | ||
mkdocs-glightbox = "^0.3.1" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/safeds/data/tabular/containers/_table/test_group_by.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from collections.abc import Callable | ||
|
||
import pytest | ||
from safeds.data.tabular.containers import Table | ||
|
||
|
||
@pytest.mark.parametrize( | ||
("table", "selector", "expected"), | ||
[ | ||
( | ||
Table({"col1": [1, 1, 2, 2, 3], "col2": ["a", "b", "c", "d", "e"]}), | ||
lambda row: row["col1"], | ||
{ | ||
1: Table({"col1": [1, 1], "col2": ["a", "b"]}), | ||
2: Table({"col1": [2, 2], "col2": ["c", "d"]}), | ||
3: Table({"col1": [3], "col2": ["e"]}), | ||
}, | ||
), | ||
( | ||
Table({"col1": [1, 1, 2, 2, 3], "col2": ["a", "b", "c", "d", 2]}), | ||
lambda row: row["col1"], | ||
{ | ||
1: Table({"col1": [1, 1], "col2": ["a", "b"]}), | ||
2: Table({"col1": [2, 2], "col2": ["c", "d"]}), | ||
3: Table({"col1": [3], "col2": [2]}), | ||
}, | ||
), | ||
(Table(), lambda row: row["col1"], {}), | ||
(Table({"col1": [], "col2": []}), lambda row: row["col1"], {}), | ||
], | ||
ids=["select by row1", "different types in column", "empty table", "table with no rows"], | ||
) | ||
def test_group_by(table: Table, selector: Callable, expected: dict) -> None: | ||
out = table.group_by(selector) | ||
assert out == expected |