Skip to content

fix(tracing): Fix InvalidOperation #4179

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

Merged

Conversation

szokeasaurusrex
Copy link
Member

InvalidOperation can occur when using tracing if the Decimal class's global context has been modified to set the precision below 6. This change fixes this bug by setting a custom context for our quantize call.

Fixes #4177

`InvalidOperation` can occur when using tracing if the `Decimal` class's global context has been modified to set the precision below 6. This change fixes this bug by setting a custom context for our `quantize` call.

Fixes #4177
Copy link

codecov bot commented Mar 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.56%. Comparing base (5715734) to head (2ae8835).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4179   +/-   ##
=======================================
  Coverage   79.56%   79.56%           
=======================================
  Files         141      141           
  Lines       15736    15736           
  Branches     2675     2675           
=======================================
+ Hits        12520    12521    +1     
  Misses       2369     2369           
+ Partials      847      846    -1     
Files with missing lines Coverage Δ
sentry_sdk/tracing_utils.py 85.50% <100.00%> (ø)

... and 1 file with indirect coverage changes

@szokeasaurusrex szokeasaurusrex merged commit 12b3ca3 into master Mar 20, 2025
139 checks passed
@szokeasaurusrex szokeasaurusrex deleted the szokeasaurusrex/fix-decimal-invalid-operation branch March 20, 2025 16:31
antonpirker pushed a commit that referenced this pull request Mar 21, 2025
`InvalidOperation` can occur when using tracing if the `Decimal` class's
global context has been modified to set the precision below 6. This
change fixes this bug by setting a custom context for our `quantize`
call.

Fixes #4177
sentrivana added a commit that referenced this pull request Mar 21, 2025
`InvalidOperation` can occur when using tracing if the `Decimal` class's
global context has been modified to set the precision below 6. This
change fixes this bug by setting a custom context for our `quantize`
call.

Fixes #4177
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.

Sentry crashing - python 3.11, AWS Lambda - x86_64
3 participants