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

{Core} Additional logic to judge whether client is track2 #21353

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

msyyc
Copy link
Member

@msyyc msyyc commented Feb 18, 2022

Description

Current logic of is_track2 is not accurate, especially when the client is patched with hidden signature: Azure/azure-sdk-for-python#23089 (comment).

@jiasli
Copy link
Member

jiasli commented Feb 18, 2022

Instead of depending on internal files like _version.py, attributes like _send_request or method signature, we definitely need a more official and solid way to determine whether a client is Track 2 or not.

@yonzhan yonzhan added this to the Feb 2022 (2022-03-01) milestone Feb 18, 2022
@@ -634,7 +634,7 @@ def is_track2(client_class):
"""
from inspect import getfullargspec as get_arg_spec
args = get_arg_spec(client_class.__init__).args
return "credential" in args
return "credential" in args or hasattr(client_class, "_send_request")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@msyyc I actually shouldn't have hid the signature yesterday, since that hides the signature for end users. I ended up changing it in the PR before you released yesterday. However this does make sense. For our new DPG generations, we expose send_request as public, so we can maybe add that check as well. But I think I did mess up yesterday by hiding the init signature, so I think it's ok for the CLI code to stay as is

Copy link
Member Author

@msyyc msyyc Feb 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the PR is discussed about in e-mail: RE: Testing candidates azure-core on CLI testsuite

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.

4 participants