Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

fixing _strip for eventually int #1667

Merged
merged 1 commit into from
Aug 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/flash/core/data/utilities/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@
return x


def _strip(x: str) -> str:
return x.strip(", ")
def _strip(x: Union[str, int]) -> str:
"""Replace both ` ` and `,` from str."""
if isinstance(x, str):
return x.strip(", ")
return str(x)

Check warning on line 49 in src/flash/core/data/utilities/classification.py

View check run for this annotation

Codecov / codecov/patch

src/flash/core/data/utilities/classification.py#L49

Added line #L49 was not covered by tests


@dataclass
Expand Down