Skip to content

Commit

Permalink
feat: rename number_of_column in Row to number_of_columns (#660)
Browse files Browse the repository at this point in the history
Closes #646

### Summary of Changes

Rename `number_of_column` in the `Row` class to `number_of_columns`.
This fixes a typo.

---------

Co-authored-by: megalinter-bot <[email protected]>
  • Loading branch information
lars-reimann and megalinter-bot authored Apr 30, 2024
1 parent 43058e9 commit 0a08296
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/safeds/data/tabular/containers/_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,20 +345,20 @@ def column_names(self) -> list[str]:
return self._schema.column_names

@property
def number_of_column(self) -> int:
def number_of_columns(self) -> int:
"""
Return the number of columns in this row.
Returns
-------
number_of_column : int
number_of_columns : int
The number of columns.
Examples
--------
>>> from safeds.data.tabular.containers import Row
>>> row = Row({"a": 1, "b": 2})
>>> row.number_of_column
>>> row.number_of_columns
2
"""
return self._data.shape[1]
Expand Down
3 changes: 1 addition & 2 deletions tests/safeds/data/tabular/containers/test_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,6 @@ def test_should_return_same_hash_for_equal_rows(self, row1: Row, row2: Row) -> N
@pytest.mark.parametrize(
("row1", "row2"),
[
(Row({"col1": 0}), Row({"col1": 1})),
(Row({"col1": 0}), Row({"col2": 0})),
(Row({"col1": 0}), Row({"col1": "a"})),
Expand Down Expand Up @@ -346,7 +345,7 @@ class TestNumberOfColumns:
],
)
def test_should_return_the_number_of_columns(self, row: Row, expected: int) -> None:
assert row.number_of_column == expected
assert row.number_of_columns == expected


class TestGetValue:
Expand Down

0 comments on commit 0a08296

Please sign in to comment.