Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typing for event_manager #52877

Closed
armenzg opened this issue Jul 14, 2023 · 0 comments · Fixed by #52974
Closed

Add typing for event_manager #52877

armenzg opened this issue Jul 14, 2023 · 0 comments · Fixed by #52974
Assignees

Comments

@armenzg
Copy link
Member

armenzg commented Jul 14, 2023

Currently, we're not checking backend types for it. We're planning to improve the performance of the save_event code, thus, we should add typing before we keep making more changes.

After removing it from pyproject.toml we get the following:

make backend-typing
--> Running Python typing checks
mypy
src/sentry/event_manager.py:48: error: Module "sentry.attachments" does not explicitly export attribute "MissingAttachmentChunks"  [attr-defined]
src/sentry/event_manager.py:58: error: Module "sentry.eventtypes" does not explicitly export attribute "CspEvent"  [attr-defined]
src/sentry/event_manager.py:58: error: Module "sentry.eventtypes" does not explicitly export attribute "DefaultEvent"  [attr-defined]
src/sentry/event_manager.py:58: error: Module "sentry.eventtypes" does not explicitly export attribute "ErrorEvent"  [attr-defined]
src/sentry/event_manager.py:58: error: Module "sentry.eventtypes" does not explicitly export attribute "ExpectCTEvent"  [attr-defined]
src/sentry/event_manager.py:58: error: Module "sentry.eventtypes" does not explicitly export attribute "ExpectStapleEvent"  [attr-defined]
src/sentry/event_manager.py:58: error: Module "sentry.eventtypes" does not explicitly export attribute "HpkpEvent"  [attr-defined]
src/sentry/event_manager.py:58: error: Module "sentry.eventtypes" does not explicitly export attribute "TransactionEvent"  [attr-defined]
src/sentry/event_manager.py:1252: error: Module has no attribute "incr_multi"  [attr-defined]
src/sentry/event_manager.py:1255: error: Module has no attribute "record_multi"  [attr-defined]
src/sentry/event_manager.py:1258: error: Module has no attribute "record_frequency_multi"  [attr-defined]
src/sentry/event_manager.py:1930: error: Module has no attribute "refund"  [attr-defined]
src/sentry/event_manager.py:1967: error: Module has no attribute "refund"  [attr-defined]
src/sentry/event_manager.py:2091: error: Module has no attribute "refund"  [attr-defined]
src/sentry/event_manager.py:2158: error: Argument 1 to "BytesIO" has incompatible type "Callable[[CachedAttachment], Any]"; expected "Buffer"  [arg-type]
src/sentry/event_manager.py:2269: error: Argument 1 to "write_to_event" of "CalculatedHashes" has incompatible type "NodeData"; expected "Dict[str, Any]"  [arg-type]
Found 16 errors in 1 files (checked 4918 source files)
@armenzg armenzg self-assigned this Jul 14, 2023
armenzg added a commit that referenced this issue Jul 14, 2023
We want to make a lot of changes to event_manager and we need to have backend typing in place for the upcoming work.

Fixes #52877
armenzg added a commit that referenced this issue Jul 17, 2023
We want to make a lot of changes to event_manager and we need to have backend typing in place for the upcoming work.

Fixes #52877
armenzg added a commit that referenced this issue Jul 17, 2023
We want to make a lot of changes to event_manager and we need to have
backend typing in place for the upcoming work.

Fixes #52877

---------

Co-authored-by: Armen Zambrano G <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Aug 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant