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 Missing __await__ Method in aiomysql Instrumentation #1305

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

TimPansino
Copy link
Contributor

Overview

  • Previously using aiomysql.sa (the included sqlalchemy engine) would result in a crash, as the library attempted to call __await__ on the _ContextManager class, which was now wrapped.
    • This has been fixed by adding a __await__() method that implements the bidirectional generator protocol, and wraps the returned cursor.

Copy link

github-actions bot commented Feb 13, 2025

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Elapsed time
❌ PYTHON ruff 3 3 1 0.07s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@codecov-commenter
Copy link

codecov-commenter commented Feb 13, 2025

Codecov Report

Attention: Patch coverage is 47.05882% with 9 lines in your changes missing coverage. Please review.

Project coverage is 81.29%. Comparing base (1efefe7) to head (b8808e2).

Files with missing lines Patch % Lines
newrelic/hooks/database_aiomysql.py 47.05% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1305      +/-   ##
==========================================
- Coverage   81.30%   81.29%   -0.02%     
==========================================
  Files         203      203              
  Lines       22492    22509      +17     
  Branches     3567     3567              
==========================================
+ Hits        18287    18298      +11     
- Misses       3019     3025       +6     
  Partials     1186     1186              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TimPansino TimPansino marked this pull request as ready for review February 13, 2025 21:03
@TimPansino TimPansino requested a review from a team as a code owner February 13, 2025 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants