Skip to content

fix(tracing): fix error when using sqlite3 backup method (backport #4246) - #4250

Merged
brettlangdon merged 11 commits into
1.5from
mergify/bp/1.5/pr-4246
Oct 6, 2022
Merged

brettlangdon merged 11 commits into
1.5from
mergify/bp/1.5/pr-4246

Conversation

@mergify

@mergify mergify Bot commented Oct 3, 2022

Copy link
Copy Markdown
Contributor

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
Comment thread tests/contrib/sqlite3/test_sqlite3.py Resolved
brettlangdon
brettlangdon previously approved these changes Oct 3, 2022
mabdinur
mabdinur previously approved these changes Oct 3, 2022
Comment thread tests/contrib/sqlite3/test_sqlite3.py Resolved
@brettlangdon
brettlangdon dismissed stale reviews from mabdinur and themself via 98e0268 October 3, 2022 16:28
@mabdinur

mabdinur commented Oct 3, 2022

Copy link
Copy Markdown
Contributor

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

@mergify

mergify Bot commented Oct 6, 2022

Copy link
Copy Markdown
Contributor Author

@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