Skip to content

Conversation

sl0thentr0py
Copy link
Member

@sl0thentr0py sl0thentr0py commented Jun 20, 2025

extracted from https://github.com/getsentry/sentry-python/pull/4487/files with lots of manual fixes

closes #2585

@sl0thentr0py sl0thentr0py force-pushed the neel/typing branch 2 times, most recently from 193076c to 17827c2 Compare June 20, 2025 19:16
Copy link

codecov bot commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 97.98032% with 39 lines in your changes missing coverage. Please review.

Project coverage is 84.86%. Comparing base (06ef70c) to head (7bfc6a0).
Report is 1 commits behind head on potel-base.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/integrations/gcp.py 0.00% 9 Missing ⚠️
sentry_sdk/integrations/aws_lambda.py 73.68% 5 Missing ⚠️
sentry_sdk/integrations/clickhouse_driver.py 64.28% 2 Missing and 3 partials ⚠️
sentry_sdk/transport.py 92.00% 3 Missing and 1 partial ⚠️
sentry_sdk/utils.py 97.24% 2 Missing and 1 partial ⚠️
sentry_sdk/integrations/spark/spark_driver.py 94.87% 2 Missing ⚠️
sentry_sdk/scope.py 98.29% 2 Missing ⚠️
sentry_sdk/_compat.py 80.00% 1 Missing ⚠️
sentry_sdk/integrations/asgi.py 93.75% 1 Missing ⚠️
sentry_sdk/integrations/atexit.py 83.33% 1 Missing ⚠️
... and 6 more
Additional details and impacted files
@@              Coverage Diff               @@
##           potel-base    #4500      +/-   ##
==============================================
+ Coverage       84.84%   84.86%   +0.01%     
==============================================
  Files             144      144              
  Lines           14882    15005     +123     
  Branches         2362     2374      +12     
==============================================
+ Hits            12627    12734     +107     
- Misses           1533     1541       +8     
- Partials          722      730       +8     
Files with missing lines Coverage Δ
sentry_sdk/_init_implementation.py 100.00% <100.00%> (ø)
sentry_sdk/_log_batcher.py 79.76% <100.00%> (+0.24%) ⬆️
sentry_sdk/_lru_cache.py 100.00% <100.00%> (ø)
sentry_sdk/_queue.py 60.00% <100.00%> (ø)
sentry_sdk/_werkzeug.py 50.00% <100.00%> (+1.85%) ⬆️
sentry_sdk/ai/monitoring.py 88.88% <100.00%> (+0.15%) ⬆️
sentry_sdk/ai/utils.py 85.71% <100.00%> (+0.71%) ⬆️
sentry_sdk/api.py 96.77% <100.00%> (+0.03%) ⬆️
sentry_sdk/attachments.py 100.00% <100.00%> (ø)
sentry_sdk/client.py 84.88% <100.00%> (ø)
... and 124 more

@sl0thentr0py sl0thentr0py force-pushed the neel/typing branch 9 times, most recently from f6d64a5 to 4b67774 Compare June 20, 2025 21:23
Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some Qs but overall looks good I think

@sl0thentr0py
Copy link
Member Author

@sentrivana fixed the casts and needed some changes to fix the resulting problems which were actually bad type signatures so fixed those too

@sl0thentr0py sl0thentr0py requested a review from sentrivana June 23, 2025 13:48
@sl0thentr0py
Copy link
Member Author

also I will keep this draft and stack the other PRs on top and merge all at once into potel-base at the end

@sl0thentr0py sl0thentr0py force-pushed the neel/typing branch 3 times, most recently from 8544214 to 34c2956 Compare June 26, 2025 11:40
@sl0thentr0py sl0thentr0py changed the title Migrate typing for core files Migrate typing Jun 26, 2025
* remove casts
* generalize `is_valid_sample_rate` to return the validated float
* added a `validate_scopes` helper method to validate the scopes entry
on the context and return the narrowed type
* added a `get_typed_attribute` helper method to narrow the type on
getting attributes from otel
* fix a flaky test on gevent
@sl0thentr0py sl0thentr0py marked this pull request as ready for review June 30, 2025 12:54
@sl0thentr0py sl0thentr0py requested a review from a team as a code owner June 30, 2025 12:54
@sl0thentr0py sl0thentr0py merged commit b07438d into potel-base Jun 30, 2025
124 checks passed
@sl0thentr0py sl0thentr0py deleted the neel/typing branch June 30, 2025 13:04
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