Skip to content

Commit

Permalink
refactor: remove unused row._copy method
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Nov 16, 2023
1 parent cb66d10 commit aea1720
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
18 changes: 1 addition & 17 deletions src/safeds/data/tabular/containers/_row.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

import copy
import functools
from collections.abc import Callable, Mapping
from typing import TYPE_CHECKING, Any
Expand Down Expand Up @@ -155,7 +154,7 @@ def __contains__(self, obj: Any) -> bool:
"""
return isinstance(obj, str) and self.has_column(obj)

def __eq__(self, other: Any) -> bool:
def __eq__(self, other: object) -> bool:
"""
Check whether this row is equal to another object.
Expand Down Expand Up @@ -531,18 +530,3 @@ def _repr_html_(self) -> str:
The generated HTML.
"""
return self._data.to_html(max_rows=1, max_cols=self._data.shape[1], notebook=True)

# ------------------------------------------------------------------------------------------------------------------
# Helpers
# ------------------------------------------------------------------------------------------------------------------

def _copy(self) -> Row:
"""
Return a copy of this row.
Returns
-------
copy : Row
The copy of this row.
"""
return copy.deepcopy(self)
12 changes: 0 additions & 12 deletions tests/safeds/data/tabular/containers/test_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,18 +514,6 @@ def test_should_contain_td_element_for_each_value(self, row: Row) -> None:
assert f"<td>{value}</td>" in row._repr_html_()


class TestCopy:
@pytest.mark.parametrize(
"row",
[Row(), Row({"a": 3, "b": 4})],
ids=["empty", "normal"],
)
def test_should_copy_table(self, row: Row) -> None:
copied = row._copy()
assert copied == row
assert copied is not row


class TestSortColumns:
@pytest.mark.parametrize(
("row", "comparator", "expected"),
Expand Down

0 comments on commit aea1720

Please sign in to comment.