Skip to content

Commit 57e7dcf

Browse files
codeSamuraiiCopilot
andcommitted
mypy
Co-authored-by: Copilot <copilot@github.com>
1 parent 80865cc commit 57e7dcf

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

pyfuse/core/task.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,19 +59,19 @@ def _encode_builtin(o: object) -> dict[str, Any] | None:
5959
def _decode_builtin(info: dict[str, Any], namespace: dict[str, Any]) -> Any:
6060
"""Reverse :func:`_encode_builtin`."""
6161
kind = info.get("type")
62-
raw = info.get("value")
62+
raw: Any = info.get("value")
6363
if kind == "datetime":
64-
return _dt.datetime.fromisoformat(raw)
64+
return _dt.datetime.fromisoformat(str(raw))
6565
if kind == "date":
66-
return _dt.date.fromisoformat(raw)
66+
return _dt.date.fromisoformat(str(raw))
6767
if kind == "time":
68-
return _dt.time.fromisoformat(raw)
68+
return _dt.time.fromisoformat(str(raw))
6969
if kind == "timedelta":
70-
return _dt.timedelta(seconds=raw)
70+
return _dt.timedelta(seconds=float(raw))
7171
if kind == "decimal":
72-
return Decimal(raw)
72+
return Decimal(str(raw))
7373
if kind == "uuid":
74-
return uuid.UUID(hex=raw)
74+
return uuid.UUID(hex=str(raw))
7575
if kind == "complex":
7676
return complex(raw[0], raw[1])
7777
if kind == "set":
@@ -84,9 +84,9 @@ def _decode_builtin(info: dict[str, Any], namespace: dict[str, Any]) -> Any:
8484
# instantiated on this platform.
8585
cls = _PATH_CLASSES.get(info.get("cls", ""), pathlib.PurePath)
8686
try:
87-
return cls(raw)
87+
return cls(str(raw))
8888
except (NotImplementedError, TypeError):
89-
return pathlib.PurePath(raw)
89+
return pathlib.PurePath(str(raw))
9090
raise ValueError(f"Unknown builtin sentinel type: {kind!r}")
9191

9292

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ asyncio_mode = "auto"
4848

4949
[tool.mypy]
5050
strict = true
51+
files = ["pyfuse"]
5152

5253
[tool.isort]
5354
profile = "black"

0 commit comments

Comments
 (0)