-
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.
Closes #695 ### Summary of Changes Add method `Column.to_table` to get a `Table` from a `Column`. --------- Co-authored-by: megalinter-bot <[email protected]>
- Loading branch information
1 parent
f8c27bc
commit 36e4a7a
Showing
2 changed files
with
35 additions
and
2 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
17 changes: 17 additions & 0 deletions
17
tests/safeds/data/tabular/containers/_column/test_to_table.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,17 @@ | ||
import pytest | ||
from safeds.data.tabular.containers import Column, Table | ||
|
||
|
||
@pytest.mark.parametrize( | ||
argnames=("column", "expected"), | ||
argvalues=[ | ||
(Column("A", []), Table({"A": []})), | ||
(Column("A", [1, 2, 3]), Table({"A": [1, 2, 3]})), | ||
], | ||
ids=[ | ||
"empty", | ||
"non-empty", | ||
], | ||
) | ||
def test_should_return_a_table_with_this_column(column: Column, expected: Table) -> None: | ||
assert column.to_table() == expected |