Skip to content

Commit

Permalink
fix: iterating over rows gives column names instead of values
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Mar 21, 2023
1 parent d8d4f00 commit 1922f60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/safeds/data/tabular/_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __getitem__(self, column_name: str) -> Any:
return self.get_value(column_name)

def __iter__(self) -> typing.Iterator[Any]:
return iter(self._data)
return iter(self.get_column_names())

def __len__(self) -> int:
return len(self._data)
Expand Down
2 changes: 1 addition & 1 deletion tests/safeds/data/tabular/_row/test_iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ def test_iter() -> None:
[0, "1"],
TableSchema({"testColumn1": IntColumnType(), "testColumn2": StringColumnType()})
)
assert list(row) == [0, "1"]
assert list(row) == ["testColumn1", "testColumn2"]

0 comments on commit 1922f60

Please sign in to comment.