Skip to content

Commit d5aa216

Browse files
committed
Typing fix
1 parent 5b03f9d commit d5aa216

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/labthings_fastapi/utilities/introspection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ def input_model_from_signature(
9595
p_type = Any if p.annotation is Parameter.empty else type_hints[name]
9696
# pydantic uses `...` to represent missing defaults (i.e. required params)
9797
default = Field(...) if p.default is Parameter.empty else p.default
98-
fields[name] = (p_type, default)
98+
# p_type below has a complicated type, but it is reasonable to
99+
# call p_type a `type` and ignore the mypy error.
100+
fields[name] = (p_type, default) # type: ignore[assignment]
99101
model = create_model( # type: ignore[call-overload]
100102
f"{func.__name__}_input",
101103
model_config=ConfigDict(extra="allow" if takes_v_kwargs else "forbid"),

0 commit comments

Comments
 (0)