Commit 0718288
fix: types for logging integration args (getsentry#444)
* fix: types for logging integration args
The sdk supports disabling the LoggingIntegration by passing `None` as
arguments; however, the current types require ints.
This behavior is noted in the docs:
https://docs.sentry.io/platforms/python/logging/#options
```
sentry_sdk.init(integrations=[LoggingIntegration(level=None, event_level=None)])
```
* fix: type for integration's arg
```python
integrations = [
LoggingIntegration(level=None, event_level=None) # type: ignore
]
sentry_sdk.init(integrations=integrations)
```
here are the type errors from mypy
```
Argument "integrations" to "init" has incompatible type "List[LoggingIntegration]"; expected "List[Integration]"
"List" is invariant -- see http://mypy.readthedocs.io/en/latest/common_issues.html#variance
Consider using "Sequence" instead, which is covariant
```
* add missing import1 parent 2c0a2ea commit 0718288
2 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
0 commit comments