Skip to content

Commit

Permalink
test: fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed May 15, 2024
1 parent 1fcb6d6 commit ec42a4c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/safeds/data/labeled/containers/_tabular_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TabularDataset(Dataset):
Examples
--------
>>> from safeds.data.labeled.containers import TabularDataset
>>> from safeds.data.tabular.containers import Table
>>> table = Table(
... {
... "id": [1, 2, 3],
Expand Down
9 changes: 1 addition & 8 deletions src/safeds/data/tabular/containers/_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,14 +1009,7 @@ def mode(
>>> from safeds.data.tabular.containers import Column
>>> column = Column("test", [3, 1, 2, 1, 3])
>>> column.mode()
+------+
| test |
| --- |
| i64 |
+======+
| 1 |
| 3 |
+------+
[1, 3]
"""
import polars as pl

Expand Down
2 changes: 1 addition & 1 deletion src/safeds/data/tabular/plotting/_table_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TablePlotter:
Examples
--------
>>> from safeds.data.tabular.containers import Table
>>> table = Table("test", [1, 2, 3])
>>> table = Table({"test": [1, 2, 3]})
>>> plotter = table.plot
"""

Expand Down
15 changes: 10 additions & 5 deletions src/safeds/data/tabular/transformation/_one_hot_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,16 @@ class OneHotEncoder(InvertibleTableTransformer):
>>> table = Table({"col1": ["a", "b", "c", "a"]})
>>> transformer = OneHotEncoder()
>>> transformer.fit_and_transform(table, ["col1"])[1]
col1__a col1__b col1__c
0 1.0 0.0 0.0
1 0.0 1.0 0.0
2 0.0 0.0 1.0
3 1.0 0.0 0.0
+---------+---------+---------+
| col1__a | col1__b | col1__c |
| --- | --- | --- |
| u8 | u8 | u8 |
+=============================+
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 0 | 1 |
| 1 | 0 | 0 |
+---------+---------+---------+
"""

# ------------------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/safeds/data/tabular/typing/_polars_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __eq__(self, other: object) -> bool:
return self._schema == other._schema

def __hash__(self) -> int:
return _structural_hash(str(self._schema))
return _structural_hash(tuple(self._schema.keys()), [str(type_) for type_ in self._schema.values()])

def __repr__(self) -> str:
return f"Schema({self!s})"
Expand Down

0 comments on commit ec42a4c

Please sign in to comment.