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)
Activity
heitorlessa commentedon Feb 9, 2021
@nmoutschen Could you please check this before you release a patch version for Tracer? This seems like a super quick fix to help MyPy customers.
Related issue with much bigger scope to support MyPy: #221
heitorlessa commentedon Feb 12, 2021
This is now available in 1.10.3 - Closing it. Thank you for reporting another one @zroger, and for the fix @nmoutschen
Merge pull request #285 from heitorlessa/chore/skip-dep-workflow