You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The model argument of BaseEnvelope and all its subclasses should be of type Type[Model], not just Model.
The same issue affects parse.
Expected Behavior
Parsing an event dict using one of the envelope classes expects a BaseModel class as a parameter and returns an instance of that class. The type signature should match.
Current Behavior
mypy complains with the error
Argument 2 to "parse" of "SqsEnvelope" has incompatible type "Type[Record]"; expected "Record"
Possible Solution
The type signature of the model argument should be changed to Type[Model].
mypy main.py
main.py:11: error: Argument 2 to "parse" of "SqsEnvelope" has incompatible type"Type[Record]"; expected "Record"
main.py:13: error: Value of type variable "Model" of "parse" cannot be "Type[Record]"
main.py:13: error: Incompatible types in assignment (expression has type"Type[Record]", variable has type"List[Optional[Record]]")
Found 3 errors in 1 file (checked 1 source file)
Environment
Python 3.8.5
aws-lambda-powertools==1.10.2
mypy==0.800
pydantic==1.7.3
The text was updated successfully, but these errors were encountered:
The
model
argument ofBaseEnvelope
and all its subclasses should be of typeType[Model]
, not justModel
.The same issue affects
parse
.Expected Behavior
Parsing an event dict using one of the envelope classes expects a
BaseModel
class as a parameter and returns an instance of that class. The type signature should match.Current Behavior
mypy complains with the error
Possible Solution
The type signature of the model argument should be changed to
Type[Model]
.Steps to Reproduce (for bugs)
Environment
The text was updated successfully, but these errors were encountered: