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

fix: preserve ARQ enqueue_job __kwdefaults__ after patching #3903

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

danmr
Copy link
Contributor

@danmr danmr commented Jan 6, 2025

Problem:

  • The ARQ integration loses __kwdefaults__ when patching the enqueue_job method
  • This causes issues when filtering kwargs in custom implementations

Solution:

  • Save original __kwdefaults__ before patching
  • Restore them in the patched function

Thank you for contributing to sentry-python! Please add tests to validate your changes, and lint your code using tox -e linters.

Running the test suite on your PR might require maintainer approval. The AWS Lambda tests additionally require a maintainer to add a special label, and they will fail until this label is added.

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.

Thanks @danmr.

@sentrivana sentrivana added the Trigger: tests using secrets PR code is safe; run CI label Jan 7, 2025
@sentrivana sentrivana enabled auto-merge (squash) January 7, 2025 11:10
@sentrivana sentrivana merged commit 235f558 into getsentry:master Jan 7, 2025
136 of 140 checks passed
Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.84%. Comparing base (fd22494) to head (380df84).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3903      +/-   ##
==========================================
- Coverage   79.89%   79.84%   -0.05%     
==========================================
  Files         139      139              
  Lines       15417    15419       +2     
  Branches     2623     2623              
==========================================
- Hits        12317    12311       -6     
- Misses       2227     2236       +9     
+ Partials      873      872       -1     
Files with missing lines Coverage Δ
sentry_sdk/integrations/arq.py 87.02% <100.00%> (+0.20%) ⬆️

... and 3 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Trigger: tests using secrets PR code is safe; run CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants