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

ref(types): Correct ExcInfo type #3266

Merged
merged 1 commit into from
Jul 10, 2024

Conversation

szokeasaurusrex
Copy link
Member

@szokeasaurusrex szokeasaurusrex commented Jul 10, 2024

Previously, we defined ExcInfo as tuple[Type[BaseException] | None, BaseException | None, TracebackType | None], when in fact, the correct type is the narrower tuple[Type[BaseException], BaseException, TracebackType | None] | tuple[None, None, None].

This change makes b0b5ecc (included in #3264) possible; previously, we would have gotten a mypy error when passing the ExcInfo tuple to logger.error

Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 79.41%. Comparing base (2cb2dca) to head (8d691f9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3266      +/-   ##
==========================================
- Coverage   79.41%   79.41%   -0.01%     
==========================================
  Files         132      132              
  Lines       14263    14265       +2     
  Branches     2992     2993       +1     
==========================================
+ Hits        11327    11328       +1     
  Misses       2091     2091              
- Partials      845      846       +1     
Files Coverage Δ
sentry_sdk/integrations/sanic.py 76.04% <0.00%> (+0.39%) ⬆️
sentry_sdk/utils.py 82.21% <50.00%> (-0.19%) ⬇️

... and 2 files with indirect coverage changes

Previously, we defined `ExcInfo` as `tuple[Type[BaseException] | None, BaseException | None, TracebackType | None]`, when in fact, the correct type is the narrower `tuple[Type[BaseException], BaseException, TracebackType | None] | tuple[None, None, None]`.
@szokeasaurusrex szokeasaurusrex force-pushed the szokeasaurusrex/improve-ExcInfo-type branch from 8d691f9 to 1f17f46 Compare July 10, 2024 14:11
@szokeasaurusrex szokeasaurusrex merged commit 1f17f46 into master Jul 10, 2024
121 of 122 checks passed
@szokeasaurusrex szokeasaurusrex deleted the szokeasaurusrex/improve-ExcInfo-type branch July 10, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants