Skip to content

Commit

Permalink
Address mypy, pyright errors
Browse files Browse the repository at this point in the history
Co-authored-by: Miloš Prchlík <happz@happz.cz>
  • Loading branch information
martinhoyer and happz committed Sep 11, 2024
1 parent 3c469b9 commit d82d2f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tmt/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class Result(BaseResult):
CheckResult.from_serialized(check) for check in serialized]
)
data_path: Optional[Path] = field(
default=None,
default=cast(Optional[Path], None),
serialize=lambda path: None if path is None else str(path),
unserialize=lambda value: None if value is None else Path(value)
)
Expand Down
3 changes: 2 additions & 1 deletion tmt/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5064,7 +5064,8 @@ def dataclass_normalize_field(
value = raw_value

if dataclasses.is_dataclass(container):
_, _, _, _, metadata = container_field(type(container), keyname)
_, _, _, _, metadata = container_field(
type(container) if not isinstance(container, type) else container, keyname)

if metadata.normalize_callback:
value = metadata.normalize_callback(key_address, raw_value, logger)
Expand Down

0 comments on commit d82d2f2

Please sign in to comment.