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
error: List item 2 has incompatible type "StructlogFormatter"; expected
"Callable[[Any, str, MutableMapping[str, Any]], Union[Mapping[str, Any], str, bytes, bytearray, tuple[Any, ...]]]" [list-item]
ecs_logging.StructlogFormatter(),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
note: "StructlogFormatter.__call__" has type "Callable[[Arg(Any, '_'), Arg(str, 'name'), Arg(dict[str, Any], 'event_dict')], str]"
StructlogFormatter is annotated as accepting a dict[str, Any], but it needs to accept any MutableMapping[str, Any]. The code already conforms to this, so addressing this issue wil hopefully only involve updating the type annotation.
The text was updated successfully, but these errors were encountered:
I've made a pull request, and I'm in the process of getting the CLA signed by my employer.
Hopefully I'm running mypy in the way that you were intending. mypy is already run by the github actions, but I'm running this as part of the tests. It's probably not necessary to be testing that mypy operates correctly in all versions of Python, but it is and it works.
AWhetter
added a commit
to AWhetter/ecs-logging-python
that referenced
this issue
Dec 2, 2024
When typechecking the following code:
mypy raises the following:
StructlogFormatter
is annotated as accepting adict[str, Any]
, but it needs to accept anyMutableMapping[str, Any]
. The code already conforms to this, so addressing this issue wil hopefully only involve updating the type annotation.The text was updated successfully, but these errors were encountered: