dd-trace-py
dd-trace-py copied to clipboard
refactor(django): import from psycopg2 lazily
Description
This change refactors the django patch module to avoid cross-importing from the psycopg2 integration, which might cause psycopg2 to be loaded, when available, even if not required by the traced application.
Checklist
- [x] Title must conform to conventional commit.
- [x] Add additional sections for
featandfixpull requests. - [x] Ensure tests are passing for affected code.
- [x] Library documentation and/or Datadog's documentation site is updated. Link to doc PR in description.
Reviewer Checklist
- [x] Title is accurate.
- [x] Description motivates each change.
- [x] No unnecessary changes were introduced in this PR.
- [x] PR cannot be broken up into smaller PRs.
- [x] Avoid breaking API changes unless absolutely necessary.
- [x] Tests provided or description of manual testing performed is included in the code or PR.
- [x] Release note has been added for fixes and features, or else
changelog/no-changeloglabel added. - [x] All relevant GitHub issues are correctly linked.
- [x] Backports are identified and tagged with Mergifyio.
- [x] Add to milestone.