clan-cli: Ignore new type hints in api/serde.py
clan-cli: Ignore new type hints in api/serde.py clan-cli: Ignore new type hints in api/serde.py clan-cli: Ignore new type hints in api/serde.py
This commit is contained in:
@@ -54,12 +54,14 @@ def update_wrapper_signature(wrapper: Callable, wrapped: Callable) -> None:
|
||||
params = list(sig.parameters.values())
|
||||
|
||||
# Add 'op_key' parameter
|
||||
op_key_param = Parameter("op_key",
|
||||
Parameter.KEYWORD_ONLY,
|
||||
# we add a None default value so that typescript code gen drops the parameter
|
||||
# FIXME: this is a hack, we should filter out op_key in the typescript code gen
|
||||
default=None,
|
||||
annotation=str)
|
||||
op_key_param = Parameter(
|
||||
"op_key",
|
||||
Parameter.KEYWORD_ONLY,
|
||||
# we add a None default value so that typescript code gen drops the parameter
|
||||
# FIXME: this is a hack, we should filter out op_key in the typescript code gen
|
||||
default=None,
|
||||
annotation=str,
|
||||
)
|
||||
params.append(op_key_param)
|
||||
|
||||
# Create a new signature
|
||||
|
||||
@@ -302,7 +302,7 @@ def construct_dataclass(
|
||||
field_value = data.get(data_field_name)
|
||||
|
||||
if field_value is None and (
|
||||
field.type is None or is_type_in_union(field.type, type(None))
|
||||
field.type is None or is_type_in_union(field.type, type(None)) # type: ignore
|
||||
):
|
||||
field_values[field.name] = None
|
||||
else:
|
||||
|
||||
@@ -119,7 +119,9 @@ def type_to_dict(
|
||||
f.type, str
|
||||
), f"Expected field type to be a type, got {f.type}, Have you imported `from __future__ import annotations`?"
|
||||
properties[f.metadata.get("alias", f.name)] = type_to_dict(
|
||||
f.type, f"{scope} {t.__name__}.{f.name}", type_map
|
||||
f.type,
|
||||
f"{scope} {t.__name__}.{f.name}", # type: ignore
|
||||
type_map, # type: ignore
|
||||
)
|
||||
|
||||
required = set()
|
||||
|
||||
Reference in New Issue
Block a user