python: enable more mypy checks 1/n (#17556)

* python: more mypy checks

* mypy: check_untyped_defs

* mypy: disallow_subclassing_any

* mypy: disallow_untyped_decorators

* mypy: disallow_any_generics
This commit is contained in:
Jonathan Ballet
2024-01-09 09:45:05 +01:00
committed by GitHub
parent c041d7e12f
commit df7976c1a3
234 changed files with 992 additions and 628 deletions

View File

@@ -73,7 +73,7 @@ class Bird(BaseModel):
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict]) -> Optional[Self]:
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of Bird from a dict"""
if obj is None:
return None

View File

@@ -73,7 +73,7 @@ class Category(BaseModel):
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict]) -> Optional[Self]:
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of Category from a dict"""
if obj is None:
return None

View File

@@ -76,7 +76,7 @@ class DataQuery(Query):
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict]) -> Optional[Self]:
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DataQuery from a dict"""
if obj is None:
return None

View File

@@ -106,7 +106,7 @@ class DefaultValue(BaseModel):
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict]) -> Optional[Self]:
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of DefaultValue from a dict"""
if obj is None:
return None

View File

@@ -75,7 +75,7 @@ class NumberPropertiesOnly(BaseModel):
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict]) -> Optional[Self]:
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of NumberPropertiesOnly from a dict"""
if obj is None:
return None

View File

@@ -99,7 +99,7 @@ class Pet(BaseModel):
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict]) -> Optional[Self]:
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of Pet from a dict"""
if obj is None:
return None

View File

@@ -84,7 +84,7 @@ class Query(BaseModel):
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Optional[Self]:
def from_dict(cls, obj: Dict[str, Any]) -> Optional[Self]:
"""Create an instance of Query from a dict"""

View File

@@ -73,7 +73,7 @@ class Tag(BaseModel):
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict]) -> Optional[Self]:
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of Tag from a dict"""
if obj is None:
return None

View File

@@ -75,7 +75,7 @@ class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseMod
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict]) -> Optional[Self]:
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter from a dict"""
if obj is None:
return None

View File

@@ -72,7 +72,7 @@ class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel):
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict]) -> Optional[Self]:
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter from a dict"""
if obj is None:
return None