You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(psycopg3): resolve attribute error raised when psycopg3 is patched [backport #5833 to 1.13] (#5866)
Backport of #5833 to 1.13
Resolves: #5821
- Fixes incorrect dbapi_async and psycopg async patches.
- Adds tests to ensure new patching is correct. Changes test to use
mark_asyncio
- Change psycopg async connection patch to use a factory, and get the
pin object from the psycopg module
- Fix psycop unpatch to correctly rebind the original connect and async
connect class methods.
- Update dbapi_async to check during `TracedAsyncCursor.__init__` if the
cursor is a `FetchTracedAsyncCursor`, in which case we don't enable
analytics sample rate stats. Previously this check was for a
`FetchTracedCursor` type, which was incorrect.
## Checklist
- [x] Change(s) are motivated and described in the PR description.
- [x] Testing strategy is described if automated tests are not included
in the PR.
- [x] Risk is outlined (performance impact, potential for breakage,
maintainability, etc).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines)
are followed.
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/)).
- [x] OPTIONAL: PR description includes explicit acknowledgement of the
performance implications of the change as reported in the benchmarks PR
comment.
## Reviewer Checklist
- [x] Title is accurate.
- [x] No unnecessary changes are introduced.
- [x] Description motivates each change.
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes unless absolutely necessary.
- [x] Testing strategy adequately addresses listed risk(s).
- [x] Change is maintainable (easy to change, telemetry, documentation).
- [x] Release note makes sense to a user of the library.
- [x] Reviewer has explicitly acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment.
---------
Co-authored-by: Munir Abdinur <[email protected]>
0 commit comments