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

overload tracing decorator to preserve type info #9994

Merged
merged 3 commits into from
Mar 9, 2020
Merged

overload tracing decorator to preserve type info #9994

merged 3 commits into from
Mar 9, 2020

Conversation

bryevdv
Copy link
Contributor

@bryevdv bryevdv commented Feb 25, 2020

This resolves the issue I was seeing in #9989 and passes all unit tests locally, but deserves some extra scrutiny given how ubiquitous it is in the codebase.

Some notes:

  • The double under in __func appears to be necessary to help inform mypy that that parameter is intended as positional only, to allow the overloads to be resolvable (ref: https://www.python.org/dev/peps/pep-0484/#positional-only-arguments)

  • Similarly absent being able to specify real kwarg-only params, name_of_span of span had to be moved to kwargs for the overloads to be resolvable

  • There don't appear to be any tests for the async decorator

@adxsdk6
Copy link

adxsdk6 commented Mar 9, 2020

Can one of the admins verify this patch?

@bryevdv bryevdv merged commit cecad1e into Azure:master Mar 9, 2020
@bryevdv bryevdv deleted the bryanv/9989_tracing_return_type branch March 9, 2020 19:51
@bryevdv bryevdv linked an issue Mar 9, 2020 that may be closed by this pull request
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Mar 10, 2020
…into web_regeneration

* 'master' of https://github.com/Azure/azure-sdk-for-python: (36 commits)
  [Storage][ADLS] API updates (Azure#10170)
  [ADLS]Update AccessPolicy and ChangeLog (Azure#10208)
  Search docs updates (Azure#10207)
  Azure-mgmt-core (Azure#5399)
  [Storage][Blob]Regenerate Swagger Code (Azure#10203)
  [Event Hubs] Fix typing.Deque problem for Python 3.5.3 (Azure#10206)
  Simplify AzureCliCredential working directory (Azure#10185)
  [ADLS]API Review Comments (Azure#10194)
  Ignore ARM pipeline clients too (Azure#10204)
  Fix async AzureCliCredential tests on Windows (Azure#10177)
  update search user agent (Azure#10201)
  [Event Hubs] Correct a doc link (Azure#10196)
  Add facet results to search page iterator (Azure#10182)
  [ADLS][Samples]Add Samples for sync and async (Azure#10123)
  overload tracing decorator to preserve type info (Azure#9994)
  Fix to handle regression test when package is missing on PyPI (Azure#10180)
  [Synapse DataPlane]Update sample (Azure#9948)
  [Event Hubs] Update README link (Azure#10184)
  [textanalytics] Refactor exceptions to use azure-core ODataV4Format (Azure#9934)
  README links update in open telemetry (Azure#10176)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracing decorators lose return type
3 participants