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(tracing): fix error when using sqlite3 backup method (backport #4246) #4250

Merged
merged 11 commits into from
Oct 6, 2022

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 3, 2022

This is an automatic backport of pull request #4246 done by Mergify.
Cherry-pick of 82b1521 has failed:

On branch mergify/bp/1.5/pr-4246
Your branch is up to date with 'origin/1.5'.

You are currently cherry-picking commit 82b15216.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   ddtrace/contrib/sqlite3/patch.py
	new file:   releasenotes/notes/fix-sqlite3-backup-bf92c698567237b9.yaml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   tests/contrib/sqlite3/test_sqlite3.py

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

## Description
SQlite3 does an explicit type check on the `target` of `backup()` if the target is also a patched connection we need to unwrap it before calling the original `backup` method.

Note: this does not add a span/tracing to `backup`

## Checklist
- [ ] Title must conform to [conventional commit](https://github.com/conventional-changelog/commitlint/tree/master/%40commitlint/config-conventional).
- [ ] Add additional sections for `feat` and `fix` pull requests.
- [ ] Ensure tests are passing for affected code.
- [ ] [Library documentation](https://github.com/DataDog/dd-trace-py/tree/1.x/docs) and/or [Datadog's documentation site](https://github.com/DataDog/documentation/) is updated. Link to doc PR in description.

## Relevant issue(s)

Fixes #4241

## Testing strategy

Added a test case/call to `backup` to ensure when the target is also a traced connection that there is no error.

## 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](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) 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-changelog` label added.
- [x] All relevant GitHub issues are correctly linked.
- [x] Backports are identified and tagged with Mergifyio.
- [ ] Add to milestone.

(cherry picked from commit 82b1521)

# Conflicts:
#	tests/contrib/sqlite3/test_sqlite3.py
@mergify mergify bot requested a review from a team as a code owner October 3, 2022 10:07
@mergify mergify bot added the conflicts label Oct 3, 2022
@mergify mergify bot removed the conflicts label Oct 3, 2022
brettlangdon
brettlangdon previously approved these changes Oct 3, 2022
mabdinur
mabdinur previously approved these changes Oct 3, 2022
@brettlangdon brettlangdon dismissed stale reviews from mabdinur and themself via 98e0268 October 3, 2022 16:28
@mabdinur
Copy link
Contributor

mabdinur commented Oct 3, 2022

We might need to backport this mypy fix from last week #4234

@mergify
Copy link
Contributor Author

mergify bot commented Oct 6, 2022

@mergify[bot] this pull request is now in conflict 😩

@mergify mergify bot added the conflicts label Oct 6, 2022
@mergify mergify bot removed the conflicts label Oct 6, 2022
@brettlangdon brettlangdon merged commit 285ddc6 into 1.5 Oct 6, 2022
@brettlangdon brettlangdon deleted the mergify/bp/1.5/pr-4246 branch October 6, 2022 19:40
@github-actions github-actions bot added this to the v1.5.1 milestone Oct 6, 2022
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.

3 participants