Repository navigation
Commit 4b364fd
authored
fix(serializer): Add type annotations to databag limits (#7505)
### Description
Add `int` annotations to `MAX_DATABAG_DEPTH` and `MAX_DATABAG_BREADTH`
in `serializer.py`.
Without them, ty infers the variables as `Literal[5]` / `Literal[10]`
and reports `invalid-assignment` when users reassign them (e.g.
`sentry_sdk.serializer.MAX_DATABAG_DEPTH = 15`). I checked this with ty
locally: the errors go away after this change. No runtime change.
As discussed in the issue, `MAX_EVENT_BYTES` is left as is.
This is my first open source contribution ever, so thanks @sentrivana
for the quick reply on the issue, and I'm happy to make any changes if
needed!
#### Issues
* resolves: #7503
* resolves: PY-27821 parent 990839c commit 4b364fd
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
0 commit comments