-
Notifications
You must be signed in to change notification settings - Fork 447
fix(tracing): ensure tracer.wrap preserves decorated function’s type #13906
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
Conversation
@zemek thanks for this contribution. We have a requirement that all contribution commits are signed, would you be able to update this PR to have signed commits? If not, I'd be more than happy to make a clone PR and squash/sign the commits with my gpg key, and I can help make sure you are still listed as co-authored on the change. |
@brettlangdon I believe I've signed the commits now, let me know if there's anything else I need to do. Thanks! |
Now there are some typing issues:
You can run these checks locally with: ./scripts/ddtest hatch run lint:checks
./scripts/ddtest hatch run lint:typing |
Head branch was pushed to by a user without write access
Ok it looks like both
succeed now (other than some errors that |
@brettlangdon it seems like the tests are failing that the Actually it looks like all |
Hey, sorry for the delay getting back to reviewing this PR. I'll try to set aside some time tomorrow to review again. I need to do some magic to get CI to run your changes, since we don't allow access to CI secrets for non-employees. |
@brettlangdon I see some tests failed in (just want to make sure this wasn't due to my change) |
I got it from here, I'll let you know if any changes are needed, these appear to be flaky jobs. |
…13906) This change reverts a regression introduced in #13480 where using `@tracer.wrap()` causes type checkers to infer the return type of decorated functions as `Any` instead of the actual return type. Addresses #13637 ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: Rachel Yang <rachel.yang@datadoghq.com> Co-authored-by: Brett Langdon <brett.langdon@datadoghq.com> (cherry picked from commit 65c54f6)
…13906) This change reverts a regression introduced in `@tracer.wrap()` causes type checkers to infer the return type of decorated functions as `Any` instead of the actual return type. Addresses #13637 - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: Joseph Zemek <jazemek@gmail.com> Co-authored-by: Rachel Yang <rachel.yang@datadoghq.com> Co-authored-by: Brett Langdon <brett.langdon@datadoghq.com>
…13906) This change reverts a regression introduced in #13480 where using `@tracer.wrap()` causes type checkers to infer the return type of decorated functions as `Any` instead of the actual return type. Addresses #13637 ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting) --------- Co-authored-by: Rachel Yang <rachel.yang@datadoghq.com> Co-authored-by: Brett Langdon <brett.langdon@datadoghq.com>
This change reverts a regression introduced in #13480 where using
@tracer.wrap()
causes type checkers to infer the return type of decorated functions asAny
instead of the actual return type.Addresses #13637
Checklist
Reviewer Checklist