Commit 2e91519
committed
fix(types): use MutableMapping to type call arguments in asgi middleware
When we bumped `opentelemetry-instrumentation-asgi` to 0.45b0, we got type errors due to the changes introduced by PR open-telemetry#2026.
```
error: Argument 1 to "add_middleware" of "Starlette" has incompatible type "type[AsgiMiddleware]"; expected "type[_MiddlewareClass[[]]]" [arg-type]
```
The problem is that it is specifying the types as `dict`, whereas Starlette requires `MutableMapping`. See https://github.com/encode/starlette/blob/9f16bf5c25e126200701f6e04330864f4a91a898/starlette/types.py#L10-L14.
I first tried to change the type to `MutableMapping`, but that produces lot of extra changes as the code is not fully typed and we seem to be using `dict`s everywhere.1 parent bd9156f commit 2e91519
File tree
1 file changed
+1
-6
lines changed- instrumentation/opentelemetry-instrumentation-asgi/src/opentelemetry/instrumentation/asgi
1 file changed
+1
-6
lines changedLines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
553 | 553 | | |
554 | 554 | | |
555 | 555 | | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
| 556 | + | |
562 | 557 | | |
563 | 558 | | |
564 | 559 | | |
| |||
0 commit comments