-
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.
feat: Add copy method for tables (#405)
Closes #275 ### Summary of Changes Added copy method for Table, TaggedTable, Row, Column and looked through code to change usage to this method. Co-authored-by: philipgutberlet <[email protected]> --------- Co-authored-by: PhilipGutberlet <[email protected]> Co-authored-by: megalinter-bot <[email protected]> Co-authored-by: Alexander <[email protected]>
- Loading branch information
1 parent
cb77790
commit 72e87f0
Showing
8 changed files
with
121 additions
and
4 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
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
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
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
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,13 @@ | ||
import pytest | ||
from safeds.data.tabular.containers import Column | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"column", | ||
[Column("a"), Column("a", ["a", 3, 0.1])], | ||
ids=["empty", "normal"], | ||
) | ||
def test_should_copy_table(column: Column) -> None: | ||
copied = column._copy() | ||
assert copied == column | ||
assert copied is not column |
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,13 @@ | ||
import pytest | ||
from safeds.data.tabular.containers import Table | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"table", | ||
[Table(), Table({"a": [], "b": []}), Table({"a": ["a", 3, 0.1], "b": [True, False, None]})], | ||
ids=["empty", "empty-rows", "normal"], | ||
) | ||
def test_should_copy_table(table: Table) -> None: | ||
copied = table._copy() | ||
assert copied == table | ||
assert copied is not table |
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
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