From 3f871ffc2fff2b04e973773233ea174501297984 Mon Sep 17 00:00:00 2001 From: "Chenxi Jiang (WICRESOFT NORTH AMERICA LTD)" Date: Tue, 5 Aug 2025 15:58:39 +0800 Subject: [PATCH 1/7] Update QAs --- QA/python-0626.md | 88 +++++++------------------------------- QA/python-0703.md | 26 +++++------- QA/python-0710.md | 20 --------- QA/python-0717.md | 24 ++--------- QA/python-0724.md | 7 +-- QA/python-0805.md | 106 ++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 138 insertions(+), 133 deletions(-) delete mode 100644 QA/python-0710.md create mode 100644 QA/python-0805.md diff --git a/QA/python-0626.md b/QA/python-0626.md index 427e7bf32155..72b64bb61c5a 100644 --- a/QA/python-0626.md +++ b/QA/python-0626.md @@ -1,58 +1,27 @@ -# Generate code cause too-many-locals and Unused import urllib.parse - -## question -Hello Language - Python Got issue with code gen... When I run lint using next-pylint -``` -tox run -e next-pylint -c ../../../eng/tox/tox.ini --root . -``` -I am getting -azure/ai/agents/aio/operations/_operations.py:1357: [R0914(too-many-locals), RunsOperations.create] Too many local variables (34/25) -azure/ai/agents/aio/operations/_operations.py:4090: [R0914(too-many-locals), AgentsClientOperationsMixin.create_agent] Too many local variables (26/25) -azure/ai/agents/aio/operations/_operations.py:4475: [R0914(too-many-locals), AgentsClientOperationsMixin.update_agent] Too many local variables (27/25) -azure/ai/agents/aio/operations/_operations.py:4815: [R0914(too-many-locals), AgentsClientOperationsMixin.create_thread_and_run] Too many local variables (32/25) -azure/ai/agents/aio/operations/_operations.py:26: [W0611(unused-import), ] Unused import urllib.parse - -The _operations.py is straightly created by code gen. Need advise how to fix them.. - -## answer -The issues you're seeing when running `next-pylint` are due to `_operations.py` being a generated file, and `next-pylint` referencing a different `pylintrc` file. - -We already have some exclusion of emitted files in the root `pylintrc`, like: - -``` -(?:.*[/\\]|^)agents/(models/_models.py|_model_base.py|operations/_operations.py|aio/operations/_operations.py)$ -``` - -So I would not expect the errors you show to be in the CI pipeline, only when you run locally. - -The problem is that `next-pylint` uses `eng/pylintrc`, and this file doesn’t include the same ignore-paths for agents. That’s an oversight on my part. - -We have a separate `pylintrc` file for `next-*` as we have to ignore the next- pylint checks added every 3 months to not break everyday CI while still allowing users to fix the next-* warnings. - -We will update the `eng/pylintrc` to align with the ignore-paths added to the root `pylintrc`. You can refer to this PR for the fix: - -https://github.com/Azure/azure-sdk-for-python/pull/41607/files - -This should address the `too-many-locals` and `unused import urllib.parse` warnings you’re seeing. - # Release pipeline failing ## question Hi Language - Python, Wondering why this pipeline is failing: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4959365&view=logs&j=447d33cb-e696-5bdf-6dab-daffaacae469 The pr checks were successfull… +``` +_ ERROR collecting sdk/healthinsights/azure-healthinsights-cancerprofiling/tests/test_cancer_profiling.py _ +ImportError while importing test module '/mnt/vss/_work/1/s/sdk/healthinsights/azure-healthinsights-cancerprofiling/tests/test_cancer_profiling.py'. +Hint: make sure your test modules/packages have valid Python names. +Traceback: +.tox/mindependency/lib/python3.13/site-packages/azure/core/rest/__init__.py:27: in + from ._rest_py3 import ( +.tox/mindependency/lib/python3.13/site-packages/azure/core/rest/_rest_py3.py:40: in + from ._helpers import ( +.tox/mindependency/lib/python3.13/site-packages/azure/core/rest/_helpers.py:28: in + import cgi +E ModuleNotFoundError: No module named 'cgi' +``` ## answer -Your nightly/internal pipeline is failing due to a Python 3.13 error that’s been happening for the past couple months. The root cause is that `azure-healthinsights-cancerprofiling` specifies too old of a minimum version of `azure-core` for Python 3.13, where `cgi` was removed. - -Your PR checks passed because you only changed `azure-healthinsights-radiologyinsights`, and the pull request build is scoped to only that package. However, internal builds are service-wide, so they include all packages in the `healthinsights` folder, even those not being released. That's why the failure surfaced internally. - -To unblock you, I ran a build that artificially limits the build scope to only `azure-healthinsights-radiologyinsights`, which should allow you to release successfully. +Your PR checks passed because you only changed `azure-healthinsights-radiologyinsights`, and the `pull request` build is scoped to only that package. However, `internal` builds are service-wide, so they include all packages in the `healthinsights` folder, even those do not have a release stage. That's why the failure is only on the `internal` build. -If `azure-healthinsights-cancerprofiling` is deprecated and not going to be released again, we should follow the deprecation process as outlined here: -https://github.com/Azure/azure-sdk-for-python/blob/main/doc/deprecation_process.md - -If we might need to release it again someday, we should fix the dependencies to keep it from falling into bitrot. +To unblock you, please run a build that artificially limits the build scope to only `azure-healthinsights-radiologyinsights` by adding variable `BuildTargetingString` with value `azure-healthinsights-radiologyinsights`. # Testing SDK PRs @@ -62,30 +31,3 @@ https://github.com/Azure/azure-sdk-for-python/pull/41428 ## answer Hi, we already commit some basic tests for the PR and we pass those test locally. For mgmt SDK, it shall be enough. Of course, it would be nice if you are willing to commit more tests by yourselves. You can refer the guidance [azure-sdk-for-python/doc/dev/tests.md at main · Azure/azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md) and our last commit for test [[AutoRelease\] t2-oracledatabase-2025-06-05-34855(can only be merged by SDK owner) by azure-sdk · Pull Request #41428 · Azure/azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python/pull/41428/commits/fbcfd9783d2933d5c3258cdb3a30d032b20170cd). - -# Code generator on python validates versions by comparing literals. - -## question -Hello, Language - Python! -We have an SDK code with three different versions: -2025-05-01 -v1 -v2025_05_15_preview ([link](https://github.com/Azure/azure-rest-api-specs/blob/87bd051c295d94fffa28a4fa6b18f8b4b71c50ec/specification/ai/Azure.AI.Agents/main.tsp#L47)) -We have added the method in version v1 and the swagger has generated correctly: this method was present in both v1 and 2025_05_15_preview ([Add thread message delete operation by nick863 · Pull Request #35320 · Azure/azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs/pull/35320/files)). When I have generated the Python code, the validation code directly [compares literals](https://github.com/Azure/azure-sdk-for-python/blob/68f3822229eba94c3fb49a29b57b8f37c85845cf/sdk/ai/azure-ai-agents/azure/ai/agents/_validation.py#L24), which leads to the fact that 2025_05_15_preview seems to be not supported anymore as "v1" is technically greater then "2025_05_15_preview". Is there a possibility to compare enum values as opposed to literals? - -## answer -The issue you're encountering is because the validation code directly compares literals, so 2025_05_15_preview seems to be not supported anymore as v1 is technically greater than 2025_05_15_preview. - -But this validation code was not designed to work when API version scheme is not consistent from a version to another, and TypeSpec semantic for version ordering is not lexical, it's the order in the file. So codegen needs to follow TypeSpec semantic since this is our source of truth. - -We confirmed this is wrong and decided to fix it. As a solution: - -I have PRs out both for disabling the versioning validation, and for validating API versioning by checking the spec ordering. - -The emitter has been released, I'm just currently in the process of updating the emitter-package.json in the azure-sdk-for-python repo. - -Once this PR passes: -https://github.com/Azure/azure-sdk-for-python/pull/41724 - -You can pull from main and try regenerating. Let me know if you see any diffs in regeneration and if these diffs work out for you. - \ No newline at end of file diff --git a/QA/python-0703.md b/QA/python-0703.md index 6fea05128656..d13bd383a2e3 100644 --- a/QA/python-0703.md +++ b/QA/python-0703.md @@ -37,7 +37,7 @@ The recommended approach is to create a custom error format class like: class BatchErrorFormat(ODataV4Format): # Custom parsing logic here ``` -Then, wrap the operation call like this: +Then, wrap the operation calls like this: ``` try: generated_client.op() @@ -56,26 +56,22 @@ class BatchExceptionPolicy: except HttpResponseError as err: raise HttpResponseError(response=err.response, model=err.model, error_format=BatchErrorFormat) from err ``` -This policy can be injected once into the client constructor using per_call_policies, making it a scalable and maintainable solution. No new feature is needed for this—it’s supported today. +Then inject the policy into the client constructor using `per_call_policies`: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/core/azure-core/CLIENT_LIBRARY_DEVELOPER.md#pipeline # pipeline got stuck ## question Hello, - I have a feature branch that won't be merged to main. I just want to release it. Before I do that, I want to make sure the pipeline is green. But it is stuck currently. Could someone help? +I have a feature branch that won't be merged to main. I just want to release it. Before I do that, I want to make sure the pipeline is green. But it is stuck currently. Could someone help? [Feature/azure ai agents/1.0.2 by howieleung · Pull Request #41623 · Azure/azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python/pull/41623) ## answer -If your pipeline is stuck and you're working from a feature branch that won't be merged to main, but you still want to release it, here's what you can do: +You can simply run your internal release build against the release branch. If it reaches the "approve release" phase, you're good to go, it's actually more certain than if you got a PR build to run. -First, although your PR has conflicts, you mentioned that rebasing isn't appropriate because the main branch contains the latest beta code, while your feature branch is for a stable release. In this case, you can simply run your internal release build against the release branch. If it reaches the "approve release" phase, you're good to go. - -You don’t have to approve a manually queued internal build, and this is consistent with how you've handled prior stable releases. Running the pipeline as a final check is understandable, even if not strictly required. - -If you're trying to maintain the PR build pattern, here's a recommended approach: - -Get your release branch to the desired state, excluding changelog and version updates. -Submit a PR targeting your release branch that includes the changelog and version updates. -The PR build will use the merge commit from both branches in the python - pullrequest pipeline, avoiding conflicts with main. -Once merged, your release branch will be in its final state, and you can queue the release build. -To clarify, the release build runs all the same tests plus a few more. If your goal is to validate the final public PR, this method works well with release branches. +Yet if you want to maintain the PR build pattern. I do have a recommendation how you can make that work with release branches. + +1. Get your release branch where you want it to be minus `changelog` and `version` updates. +2. Submit a PR targeting your release branch with the `changelog` and `version` updates. the PR build will use the merge commit from both your branches in the `python - pullrequest` pipeline, instead of hitting conflicts with `main`. +3. Merge that. Your release branch will be in final state, which you can queue the release build for. + +To be clear, your release build will run all the same tests + a couple more, but if it's really about the last public PR then that's how you would do it with a release branch diff --git a/QA/python-0710.md b/QA/python-0710.md deleted file mode 100644 index 0d3b71b04d3f..000000000000 --- a/QA/python-0710.md +++ /dev/null @@ -1,20 +0,0 @@ -# How to make code gen to generate `AgentsOperations` instead of `AgentsClientOperationsMixin` - -## question -Hello Language - Python - -I have code gen generated -``` -class AgentsClientOperationsMixin( - ClientMixinABC[AsyncPipelineClient[HttpRequest, AsyncHttpResponse], AgentsClientConfiguration] -): -``` -Is it possible to generate `AgentsOperations` -This class is public. So I want a better name. - -## answer -The AgentsClientOperationsMixin class should not be documented or publicly exposed. Although it is currently accessible via from azure.ai.agents.operations import AgentsClientOperationsMixin, this visibility causes it to appear in public documentation like Microsoft Learn, which is not intended. - -After discussion, the Python SDK team concluded that the correct solution is to make the mixin operation group a private class. This change ensures the class is hidden from public documentation while maintaining compatibility with the generated code. - -The issue has been tracked in https://github.com/microsoft/typespec/issues/7803, and the fix has been implemented in https://github.com/microsoft/typespec/pull/7817. diff --git a/QA/python-0717.md b/QA/python-0717.md index 3054116726ec..8ea68f63f3fe 100644 --- a/QA/python-0717.md +++ b/QA/python-0717.md @@ -1,33 +1,17 @@ -# API View Displays Incorrect Python Package Name - -## question -Hi team, - -I am generating the Python SDK api view for sdk review meeting. After I followed the instruction here to generate Python package: [What to do after generating the SDK code with codegen · Azure/azure-sdk-for-python Wiki](https://github.com/Azure/azure-sdk-for-python/wiki/What-to-do-after-generating-the-SDK-code-with-codegen#how-to-create-package). It generate a package name like this: **azure_ai_language_text-1.0.0b1-py3-none-any.whl**, with long suffix. And after uploading it to Api view, it still keep the same long name: -`azure_ai_language_text-1.0.0b1-py3-none-any.whl` -But I noticed that in the previous version api view, the Python namespace only show simplified verison like this : -`azure-ai-language-conversations` -Should I manually modify the package name before uploading it to api view, or is there anything that I was missing? Thank you! - -## answer -Hi, this is a bug in the parser and an issue is filed for it here. [[Python APIView\] manual uploads have the whl as the title name · Issue #10459 · Azure/azure-sdk-tools](https://github.com/Azure/azure-sdk-tools/issues/10459) - -I'm currently working on fixing this. Is there a particular reason for the manual upload? Otherwise, you can auto-generate the APIView with the correct name by opening up a PR in the azure-sdk-for-python repo with the changes. - # Python Live Test for async api ## question Hello Language - Python, - + We at Callautomation are working on adding live tests for the async APIs. When I tried to run a live test, I encountered an SSL certificate issue, as shown below. Could you help me understand what I might be missing? - + ``` except aiohttp.client_exceptions.ClientError as err: > raise ServiceRequestError(err, error=err) from err E azure.core.exceptions.ServiceRequestError: Cannot connect to host localhost:5001 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1028)')] -``` - + C:\Users\v-dharmarajv\AppData\Local\Programs\Python\Python313\Lib\site-packages\azure\core\pipeline\transport\_aiohttp.py:364: ServiceRequestError +``` ## answer You're encountering an SSL certificate error when running live tests for async APIs, specifically when connecting to https://localhost:5001. This is the test proxy endpoint, and the error is likely due to certificate verification failing. Although the same code works for another team member, the issue may be caused by environment variables — either missing or incorrectly set. diff --git a/QA/python-0724.md b/QA/python-0724.md index aa9ea624bafd..fa7af3527288 100644 --- a/QA/python-0724.md +++ b/QA/python-0724.md @@ -85,10 +85,10 @@ But the issue still persists. Has anyone encountered this before or could share ## answer Maybe you could try install "uv" (here is guidance [Installation | uv](https://docs.astral.sh/uv/getting-started/installation/)) and sync with latest main branch of python sdk repo then try again. -# "The date for the changelog being released must be the latest in the file." +# The date for the changelog being released must be the latest in the file. ## question -We have this PR to Main branch that updates CHANGELOG.md: https://github.com/Azure/azure-sdk-for-python/pull/42064 . The change looks correct to me... adding `## 1.0.0b13 (Unreleased)`. Yet the PR build pipeline has an error in the Analyze job titled "Verify ChangeLogEntries": https://dev.azure.com/azure-sdk/public/_build/results?buildId=5108808&view=logs&j=b70e5e73-bbb6-5567-0939-8415943fadb9&t=ac8f4042-9b76-5db4-27b1-2a4abaa9bb3c : +We have this PR to Main branch that updates CHANGELOG.md: https://github.com/Azure/azure-sdk-for-python/pull/42064 . The change looks correct to me... adding `## 1.0.0b13 (Unreleased)`. Yet the PR build pipeline has an error in the Analyze job titled "Verify ChangeLogEntries": ``` [debug]Verifying as a release build because the changelog entry has a valid date. ##[error]Invalid date [ 2025-06-23 ]. The date for the changelog being released must be the latest in the file. @@ -104,10 +104,7 @@ We have this PR to Main branch that updates CHANGELOG.md: https://github.com/Azu Finishing: Verify ChangeLogEntries ``` -##[error]Invalid date [ 2025-06-23 ]. The date for the changelog being released must be the latest in the file. - Any idea why? Seems like a tool bug to me. ## answer The error occurred because the changelog entry for version `1.0.0b13 (Unreleased)` was added without updating the `_version.py` file. the tool gets the version from there and tries to validate the change log entry for that version. In this case it sees that version isn't the latest version in the changelog and complains (granted the error message could be better). However, the version update is what is missing. Also, looks like a lot of version increment PRs have been getting ignored. It might be worth taking these PR and then pulling them into your feature branches. However if you don't plan to use them then just close them. - \ No newline at end of file diff --git a/QA/python-0805.md b/QA/python-0805.md new file mode 100644 index 000000000000..7da0ba0d2a37 --- /dev/null +++ b/QA/python-0805.md @@ -0,0 +1,106 @@ +# SecurityInsights missing credential_scope update when targeting azure gov cloud + +## question +Hey Team, Not sure if its a bug or rather a missing feature. But when utilizing (azure.mgmt.securityinsight.SecurityInsights class | Microsoft Learn)[https://learn.microsoft.com/en-us/python/api/azure-mgmt-securityinsight/azure.mgmt.securityinsight.securityinsights?view=azure-python] and specifying the base_url to point to azure gov - Along with the ClientSecretCredential pointing to us gov. The credential_Scope doesn't get updated. Instead it will fail with: +``` +(InvalidAuthenticationTokenAudience) The 'EvolvedSecurityTokenService' access token has been obtained for wrong audience or resource 'https://management.azure.com'. It should exactly match with one of the allowed audiences 'https://management.core.usgovcloudapi.net/','https://management.core.usgovcloudapi.net','https://management.usgovcloudapi.net/','https://management.usgovcloudapi.net'. +Code: InvalidAuthenticationTokenAudience +``` +Had to dig into the sdk to understand how to override this... basically, we are just passing in the credential_scopes which will get passed thru +-> https://github.com/Azure/azure-sdk-for-python/blob/6e86b7a2820bf1db476f9505cdad4b51f2dd00ab/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_security_insights.py#L174 +``` +self._config = SecurityInsightsConfiguration(credential=credential, subscription_id=subscription_id, **kwargs) +``` +-- TO---> https://github.com/Azure/azure-sdk-for-python/blob/6e86b7a2820bf1db476f9505cdad4b51f2dd00ab/sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/_configuration.py#L55 +``` +self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) +``` + +Working Example found here: (Sentinel_Rules_Gov_Example/test_sentinel.py at main · VinnyBonner/Sentinel_Rules_Gov_Example)[https://github.com/VinnyBonner/Sentinel_Rules_Gov_Example/blob/main/test_sentinel.py] +``` +SUBSCRIPTION_ID = '' +RESOURCE_GRP = '' +WORKSPACES = [''] +CLIENT_ID = '' +TENANT_ID = '' + + +AZURE_GOVERNMENT_AUTHORITY = "https://login.microsoftonline.us/" +AZURE_GOVERNMENT_MANAGEMENT = "https://management.usgovcloudapi.net" +SCOPE = "https://management.usgovcloudapi.net/.default" + +class Sentinel: + """Use RestAPI to communicate with Sentinel directly""" + + def __init__(self, secret: str) -> None: + """Info needed to connect, authenticate to Sentinel""" + + self.creds = ClientSecretCredential(tenant_id=TENANT_ID, client_id=CLIENT_ID, client_secret=secret, authority=AZURE_GOVERNMENT_AUTHORITY, base_url=AZURE_GOVERNMENT_MANAGEMENT) + + def __enter__(self) -> Sentinel: + if 'Windows' in platform.system(): # avoid certificate validation on Windows??? + os.environ['REQUESTS_CA_BUNDLE'] = '' + os.environ['CURL_CA_BUNDLE'] = '' + try: + self.client = SecurityInsights(credential=self.creds, subscription_id=SUBSCRIPTION_ID, base_url=AZURE_GOVERNMENT_MANAGEMENT, credential_scopes=[SCOPE]) + except (ValueError, ClientAuthenticationError) as err: + print(f'unable to authenticate to sentinel: {err}') + return self +``` + +Easy way to break it and reproduce the error is update line 36 by removing the credential_scopes kwargs - update line 36 to the below +``` +self.client = SecurityInsights(credential=self.creds, subscription_id=SUBSCRIPTION_ID, base_url=AZURE_GOVERNMENT_MANAGEMENT) +``` + +This will reproduce the issue. + +So the question / reason for the post... +Can you consider one of the following: +Update documentation so developers know they also need to pass in the credential_scope +OR +Update the code so that it will use the base_url passed in plus the /.default for the credential_scope when creating the config + +Just some way so that customers working in the gov space know how to properly configure the code to connect to the sovereign clouds like US GOV FairFax. + +Happy to demo/walk thru if you need it since it does require gov sub. + +Thanks! + +## answer +Thanks for the feedback. Here is the doc to show how to use non-public cloud: (Connect to all regions using Azure libraries for Python multicloud - Python on Azure | Microsoft Learn)[https://learn.microsoft.com/en-us/azure/developer/python/sdk/azure-sdk-sovereign-domain]. +``` +resource_client = ResourceManagementClient( + credential, subscription_id, + base_url=resource_manager, + credential_scopes=[resource_manager + "/.default"]) +``` + +Yet as requiring users to provide duplicated information is not ideal, we have developed a new experience where users only need to supply the cloud information, and the library automatically handles the rest. This new behavior will be available once a new version of the library is released. Reference implementation: [azure-sdk-for-python AppConfiguration client](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/appconfiguration/azure-mgmt-appconfiguration/azure/mgmt/appconfiguration/_app_configuration_management_client.py#L73). +``` +resource_client = ResourceManagementClient( + credential, subscription_id, + cloud_setting=resource_manager, +``` + +# Entitlement Required for SDK Generation Pipeline Access + +## question +Hi team, + +I'm currently working on generating the Python SDK using the pipeline: (Using the SDK generation pipelines)[https://eng.ms/docs/products/azure-developer-experience/develop/sdk-generation-pipelines]. Although I have write access to the related GitHub repositories, I’m unable to access the pipeline itself. +Could you please let me know which entitlement is required for this access? Thank you! + +## answer +https://aka.ms/azsdk/access +``` +You'll need a GitHub account to contribute to Azure REST API and SDK repositories. Before you get started, be sure that you also: + +Join the Microsoft organization on GitHub. +Join the Azure organization. +Check the visibility of your Microsoft and Azure org memberships. + +If you're working on branches in the main repo for your spec, or working in the Azure SDK repositories to submit pull requests or serving as the support contact for issues, you'll need write access so that you can apply or dismiss labels, create or modify issues, and assign issues to others. It also allows you to add/update test recordings in the test assets repo. + +To get access to Azure SDK repos, request to join the (Azure SDK Partners)[https://aka.ms/azsdk/join/azuresdkpartners] and have the request approved by your manager. After your manager approves, it may take up to one day for you to automatically be added to the (azure-sdk-partners)[https://github.com/orgs/Azure/teams/azure-sdk-partners] GitHub team. This will get you write access to all Azure SDK related repos. These membership requests will need to be renewed every 180 days. +``` From 9453431e1804b82b1cbf7b0aaf502f21d120a71d Mon Sep 17 00:00:00 2001 From: "Chenxi Jiang (WICRESOFT NORTH AMERICA LTD)" Date: Tue, 5 Aug 2025 16:28:16 +0800 Subject: [PATCH 2/7] Update skip reasons --- QA/skip_question.json | 65 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 QA/skip_question.json diff --git a/QA/skip_question.json b/QA/skip_question.json new file mode 100644 index 000000000000..e95f275bc8ab --- /dev/null +++ b/QA/skip_question.json @@ -0,0 +1,65 @@ + +{ + "skip": [ + { + "question": "[Test] 'The date for the changelog being released must be the latest in the file.'", + "reason": "Built for Q&A Bot test." + }, + { + "question": "BreakingChange-Python-SDK review", + "reason": "Review request." + }, + { + "question": "Generate code cause too-many-locals and Unused import urllib.parse", + "reason": "Bug issue." + }, + { + "question": "Code generator on python validates versions by comparing literals.", + "reason": "Bug issue." + }, + { + "question": "How to make code gen to generate `AgentsOperations` instead of `AgentsClientOperationsMixin`", + "reason": "Bug issue." + }, + { + "question": "API View Displays Incorrect Python Package Name", + "reason": "Bug issue." + }, + { + "question": "Incorrect client used in generated samples", + "reason": "Bug issue." + }, + { + "question": "Merge to main pipeline fail for macos311 without showing errors", + "reason": "Bug issue." + }, + { + "question": "Unable to Trigger SDK Generation Pipeline", + "reason": "No further resolution needed." + }, + { + "question": "Releasing Python SDK", + "reason": "No further resolution needed." + }, + { + "question": "Updating python repo to Ubuntu-24.04", + "reason": "No further resolution needed." + }, + { + "question": "Secret env var handling", + "reason": "No outcomes for more than a month." + }, + { + "question": "Output breaking change after bumping `azure-keyvault-keys`", + "reason": "No outcomes for more than a month." + }, + { + "question": "Playback mode not working in the pipeline", + "reason": "No outcomes for more than a month." + }, + { + "question": "Streaming response timeouts when using azure-ai-agents library", + "reason": "No outcomes for more than a month." + } + ] +} \ No newline at end of file From 44cad4824e171c90c294ed1cee45da1404247fb6 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Tue, 5 Aug 2025 16:37:09 +0800 Subject: [PATCH 3/7] Update skip_question.json --- QA/skip_question.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/QA/skip_question.json b/QA/skip_question.json index 8690c6de1535..f4cadb1c8ff8 100644 --- a/QA/skip_question.json +++ b/QA/skip_question.json @@ -47,19 +47,19 @@ }, { "question": "Secret env var handling", - "reason": "No outcomes for more than a month." + "reason": "No outcome for more than a month." }, { "question": "Output breaking change after bumping `azure-keyvault-keys`", - "reason": "No outcomes for more than a month." + "reason": "No outcome for more than a month." }, { "question": "Playback mode not working in the pipeline", - "reason": "No outcomes for more than a month." + "reason": "No outcome for more than a month." }, { "question": "Streaming response timeouts when using azure-ai-agents library", - "reason": "No outcomes for more than a month." + "reason": "No outcome for more than a month." } ] } From e4f0b9b71986f636cd7f3fd7105f3d4e6342c5c2 Mon Sep 17 00:00:00 2001 From: "Chenxi Jiang (WICRESOFT NORTH AMERICA LTD)" Date: Wed, 6 Aug 2025 14:30:39 +0800 Subject: [PATCH 4/7] revert deleted QAs --- QA/python-0626.md | 63 ++++++++++++ QA/python-0710.md | 20 ++++ QA/python-0717.md | 15 ++- QA/python-0724.md | 87 ---------------- QA/python-0806.md | 230 ++++++++++++++++++++++++++++++++++++++++++ QA/skip_question.json | 8 ++ 6 files changed, 335 insertions(+), 88 deletions(-) create mode 100644 QA/python-0710.md create mode 100644 QA/python-0806.md diff --git a/QA/python-0626.md b/QA/python-0626.md index 72b64bb61c5a..529e0727bc1b 100644 --- a/QA/python-0626.md +++ b/QA/python-0626.md @@ -1,3 +1,40 @@ +# Generate code cause too-many-locals and Unused import urllib.parse + +## question +Hello Language - Python Got issue with code gen... When I run lint using next-pylint +``` +tox run -e next-pylint -c ../../../eng/tox/tox.ini --root . +``` +I am getting +azure/ai/agents/aio/operations/_operations.py:1357: [R0914(too-many-locals), RunsOperations.create] Too many local variables (34/25) +azure/ai/agents/aio/operations/_operations.py:4090: [R0914(too-many-locals), AgentsClientOperationsMixin.create_agent] Too many local variables (26/25) +azure/ai/agents/aio/operations/_operations.py:4475: [R0914(too-many-locals), AgentsClientOperationsMixin.update_agent] Too many local variables (27/25) +azure/ai/agents/aio/operations/_operations.py:4815: [R0914(too-many-locals), AgentsClientOperationsMixin.create_thread_and_run] Too many local variables (32/25) +azure/ai/agents/aio/operations/_operations.py:26: [W0611(unused-import), ] Unused import urllib.parse + +The _operations.py is straightly created by code gen. Need advise how to fix them.. + +## answer +The issues you're seeing when running `next-pylint` are due to `_operations.py` being a generated file, and `next-pylint` referencing a different `pylintrc` file. + +We already have some exclusion of emitted files in the root `pylintrc`, like: + +``` +(?:.*[/\\]|^)agents/(models/_models.py|_model_base.py|operations/_operations.py|aio/operations/_operations.py)$ +``` + +So I would not expect the errors you show to be in the CI pipeline, only when you run locally. + +The problem is that `next-pylint` uses `eng/pylintrc`, and this file doesn’t include the same ignore-paths for agents. That’s an oversight on my part. + +We have a separate `pylintrc` file for `next-*` as we have to ignore the next- pylint checks added every 3 months to not break everyday CI while still allowing users to fix the next-* warnings. + +We will update the `eng/pylintrc` to align with the ignore-paths added to the root `pylintrc`. You can refer to this PR for the fix: + +https://github.com/Azure/azure-sdk-for-python/pull/41607/files + +This should address the `too-many-locals` and `unused import urllib.parse` warnings you’re seeing. + # Release pipeline failing ## question @@ -31,3 +68,29 @@ https://github.com/Azure/azure-sdk-for-python/pull/41428 ## answer Hi, we already commit some basic tests for the PR and we pass those test locally. For mgmt SDK, it shall be enough. Of course, it would be nice if you are willing to commit more tests by yourselves. You can refer the guidance [azure-sdk-for-python/doc/dev/tests.md at main · Azure/azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md) and our last commit for test [[AutoRelease\] t2-oracledatabase-2025-06-05-34855(can only be merged by SDK owner) by azure-sdk · Pull Request #41428 · Azure/azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python/pull/41428/commits/fbcfd9783d2933d5c3258cdb3a30d032b20170cd). + +# Code generator on python validates versions by comparing literals. + +## question +Hello, Language - Python! +We have an SDK code with three different versions: +2025-05-01 +v1 +v2025_05_15_preview ([link](https://github.com/Azure/azure-rest-api-specs/blob/87bd051c295d94fffa28a4fa6b18f8b4b71c50ec/specification/ai/Azure.AI.Agents/main.tsp#L47)) +We have added the method in version v1 and the swagger has generated correctly: this method was present in both v1 and 2025_05_15_preview ([Add thread message delete operation by nick863 · Pull Request #35320 · Azure/azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs/pull/35320/files)). When I have generated the Python code, the validation code directly [compares literals](https://github.com/Azure/azure-sdk-for-python/blob/68f3822229eba94c3fb49a29b57b8f37c85845cf/sdk/ai/azure-ai-agents/azure/ai/agents/_validation.py#L24), which leads to the fact that 2025_05_15_preview seems to be not supported anymore as "v1" is technically greater then "2025_05_15_preview". Is there a possibility to compare enum values as opposed to literals? + +## answer +The issue you're encountering is because the validation code directly compares literals, so 2025_05_15_preview seems to be not supported anymore as v1 is technically greater than 2025_05_15_preview. + +But this validation code was not designed to work when API version scheme is not consistent from a version to another, and TypeSpec semantic for version ordering is not lexical, it's the order in the file. So codegen needs to follow TypeSpec semantic since this is our source of truth. + +We confirmed this is wrong and decided to fix it. As a solution: + +I have PRs out both for disabling the versioning validation, and for validating API versioning by checking the spec ordering. + +The emitter has been released, I'm just currently in the process of updating the emitter-package.json in the azure-sdk-for-python repo. + +Once this PR passes: +https://github.com/Azure/azure-sdk-for-python/pull/41724 + +You can pull from main and try regenerating. Let me know if you see any diffs in regeneration and if these diffs work out for you. diff --git a/QA/python-0710.md b/QA/python-0710.md new file mode 100644 index 000000000000..6c1f84c73ac3 --- /dev/null +++ b/QA/python-0710.md @@ -0,0 +1,20 @@ +# How to make code gen to generate `AgentsOperations` instead of `AgentsClientOperationsMixin` + +## question +Hello Language - Python + +I have code gen generated +``` +class AgentsClientOperationsMixin( + ClientMixinABC[AsyncPipelineClient[HttpRequest, AsyncHttpResponse], AgentsClientConfiguration] +): +``` +Is it possible to generate `AgentsOperations` +This class is public. So I want a better name. + +## answer +The AgentsClientOperationsMixin class should not be documented or publicly exposed. Although it is currently accessible via from azure.ai.agents.operations import AgentsClientOperationsMixin, this visibility causes it to appear in public documentation like Microsoft Learn, which is not intended. + +After discussion, the Python SDK team concluded that the correct solution is to make the mixin operation group a private class. This change ensures the class is hidden from public documentation while maintaining compatibility with the generated code. + +The issue has been tracked in https://github.com/microsoft/typespec/issues/7803, and the fix has been implemented in https://github.com/microsoft/typespec/pull/7817. \ No newline at end of file diff --git a/QA/python-0717.md b/QA/python-0717.md index 8ea68f63f3fe..9d1f7143fde4 100644 --- a/QA/python-0717.md +++ b/QA/python-0717.md @@ -1,3 +1,17 @@ +## question +Hi team, + +I am generating the Python SDK api view for sdk review meeting. After I followed the instruction here to generate Python package: [What to do after generating the SDK code with codegen · Azure/azure-sdk-for-python Wiki](https://github.com/Azure/azure-sdk-for-python/wiki/What-to-do-after-generating-the-SDK-code-with-codegen#how-to-create-package). It generate a package name like this: **azure_ai_language_text-1.0.0b1-py3-none-any.whl**, with long suffix. And after uploading it to Api view, it still keep the same long name: +`azure_ai_language_text-1.0.0b1-py3-none-any.whl` +But I noticed that in the previous version api view, the Python namespace only show simplified verison like this : +`azure-ai-language-conversations` +Should I manually modify the package name before uploading it to api view, or is there anything that I was missing? Thank you! + +## answer +Hi, this is a bug in the parser and an issue is filed for it here. [[Python APIView\] manual uploads have the whl as the title name · Issue #10459 · Azure/azure-sdk-tools](https://github.com/Azure/azure-sdk-tools/issues/10459) + +I'm currently working on fixing this. Is there a particular reason for the manual upload? Otherwise, you can auto-generate the APIView with the correct name by opening up a PR in the azure-sdk-for-python repo with the changes. + # Python Live Test for async api ## question @@ -17,4 +31,3 @@ C:\Users\v-dharmarajv\AppData\Local\Programs\Python\Python313\Lib\site-packages\ You're encountering an SSL certificate error when running live tests for async APIs, specifically when connecting to https://localhost:5001. This is the test proxy endpoint, and the error is likely due to certificate verification failing. Although the same code works for another team member, the issue may be caused by environment variables — either missing or incorrectly set. To run live tests, make sure AZURE_TEST_RUN_LIVE is set to "true". If you also want to record, avoid setting AZURE_SKIP_LIVE_RECORDING. As a workaround for the SSL issue, set the environment variable PROXY_URL to http://localhost:5000 instead of using HTTPS. This bypasses certificate validation and resolves the issue. - \ No newline at end of file diff --git a/QA/python-0724.md b/QA/python-0724.md index fa7af3527288..cad35844e2ac 100644 --- a/QA/python-0724.md +++ b/QA/python-0724.md @@ -1,90 +1,3 @@ -# tsp-client update failed when generating Python SDK - -## question -Hi team, -I've updated my TypeSpec PR (link: [[Conv Authoring] modify Python clientname 20250515preview](https://github.com/Azure/azure-rest-api-specs/pull/36074)) and am using the latest commit ID to generate the Python SDK via `tsp-client update`. However, the command consistently fails with the following error: -``` -npm warn cleanup Failed to remove some directories [ -npm warn cleanup [ -npm warn cleanup '\\\\?\\C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec\\compiler', -npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@typespec\compiler\dist\src\core'] { -npm warn cleanup errno: -4048, -npm warn cleanup code: 'EPERM', -npm warn cleanup syscall: 'rmdir', -npm warn cleanup path: 'C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec\\compiler\\dist\\src\\core' -npm warn cleanup } -npm warn cleanup ], -npm warn cleanup [ -npm warn cleanup '\\\\?\\C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec', -npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@typespec\http-client-python\generator\build\lib\pygen\codegen'] { -npm warn cleanup errno: -4048, -npm warn cleanup code: 'EPERM', -npm warn cleanup syscall: 'rmdir', -npm warn cleanup path: 'C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec\\http-client-python\\generator\\build\\lib\\pygen\\codegen' -npm warn cleanup } -npm warn cleanup ], -npm warn cleanup [ -npm warn cleanup '\\\\?\\C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec\\http-client-python', -npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@typespec\http-client-python\venv\Lib\site-packages\pip\_vendor'] { -npm warn cleanup errno: -4048, -npm warn cleanup code: 'EPERM', -npm warn cleanup syscall: 'rmdir', -npm warn cleanup path: 'C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec\\http-client-python\\venv\\Lib\\site-packages\\pip\\_vendor' -npm warn cleanup } -npm warn cleanup ], -npm warn cleanup [ -npm warn cleanup '\\\\?\\C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@azure-tools', -npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@azure-tools\typespec-python\venv'] { -npm warn cleanup errno: -4048, -npm warn cleanup code: 'EPERM', -npm warn cleanup syscall: 'rmdir', -npm warn cleanup path: 'C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@azure-tools\\typespec-python\\venv' -npm warn cleanup } -npm warn cleanup ] -npm warn cleanup ] -npm error code 1 -npm error path C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@azure-tools\typespec-python -npm error command failed -npm error command C:\WINDOWS\system32\cmd.exe /d /s /c tsx ./scripts/run-python3.ts ./scripts/install.py -npm error Traceback (most recent call last): -npm error File "C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@azure-tools\typespec-python\scripts\install.py", line 46, in -npm error main() -npm error ~~~~^^ -npm error File "C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@azure-tools\typespec-python\scripts\install.py", line 39, in main -npm error venv_context = create_venv_with_package_manager(venv_path) -npm error File "C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@azure-tools\typespec-python\scripts\package_manager.py", line 140, in create_venv_with_package_manager -npm error env_builder.create(venv_path) -npm error ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ -npm error File "C:\Users\v-amberchen\AppData\Local\Programs\Python\Python313\Lib\venv\__init__.py", line 82, in create -npm error self._setup_pip(context) -npm error ~~~~~~~~~~~~~~~^^^^^^^^^ -npm error File "C:\Users\v-amberchen\AppData\Local\Programs\Python\Python313\Lib\venv\__init__.py", line 446, in _setup_pip -npm error self._call_new_python(context, '-m', 'ensurepip', '--upgrade', -npm error ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -npm error '--default-pip', stderr=subprocess.STDOUT) -npm error ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -npm error File "C:\Users\v-amberchen\AppData\Local\Programs\Python\Python313\Lib\venv\__init__.py", line 442, in _call_new_python -npm error subprocess.check_output(args, **kwargs) -npm error ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ -npm error File "C:\Users\v-amberchen\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 472, in check_output -npm error return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, -npm error ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -npm error **kwargs).stdout -npm error ^^^^^^^^^ -npm error File "C:\Users\v-amberchen\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 577, in run -npm error raise CalledProcessError(retcode, process.args, -npm error output=stdout, stderr=stderr) -npm error subprocess.CalledProcessError: Command '['C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@azure-tools\\typespec-python\\venv\\Scripts\\python.exe', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. -npm error Error: Command failed: py -3 ./scripts/install.py -npm error A complete log of this run can be found in: C:\Users\v-amberchen\AppData\Local\npm-cache\_logs\2025-07-21T22_34_40_381Z-debug-0.log -update -``` -I've checked my Python installation `ensurepip` is satisfied, tried manually deleting the `TempTypeSpecFiles` folder or running the command in an Administrator terminal.... -But the issue still persists. Has anyone encountered this before or could share some insights? Any help would be much appreciated. Thank you! - -## answer -Maybe you could try install "uv" (here is guidance [Installation | uv](https://docs.astral.sh/uv/getting-started/installation/)) and sync with latest main branch of python sdk repo then try again. - # The date for the changelog being released must be the latest in the file. ## question diff --git a/QA/python-0806.md b/QA/python-0806.md new file mode 100644 index 000000000000..f022446e486f --- /dev/null +++ b/QA/python-0806.md @@ -0,0 +1,230 @@ +# Azure Monitor OTEL SDK not working + +## question +Hi there, I am trying to try to use the (Azure Monitor OTEL Exporter)[https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-opentelemetry-exporter#microsoft-opentelemetry-exporter-for-azure-monitor] for a python application, and I am having trouble getting data flow when I follow the examples of setting up the exporter. I tried to copy the (hello world sample code)[https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-opentelemetry-exporter#export-hello-world-trace] and put my connection string, and I'm still not seeing any tracing data land in my traces table in my App Insights instance. Could I get some help here to figure out what is going on, or where the sample code might not be functional? + +I tried to look through the debug logs: +``` +2025-05-20 22:57:57,387 DEBUG urllib3.connectionpool Starting new HTTP connection (1): 169.254.169.254:80 +2025-05-20 22:57:57,396 DEBUG urllib3.connectionpool http://169.254.169.254:80 "GET /metadata/instance/compute?api-version=2017-12-01&format=json HTTP/1.1" 200 636 +2025-05-20 22:57:57,400 INFO azure.core.pipeline.policies.http_logging_policy Request URL: 'https://westus-0.in.applicationinsights.azure.com//v2.1/track' +Request method: 'POST' +Request headers: + 'Content-Type': 'application/json' + 'Content-Length': '1545' + 'Accept': 'application/json' + 'x-ms-client-request-id': 'defa6d6e-35cd-11f0-a616-3bc028b7fd3a' + 'User-Agent': 'azsdk-python-azuremonitorclient/unknown Python/3.10.12 (Linux-6.5.0-1025-azure-x86_64-with-glibc2.35)' +A body is sent with the request +2025-05-20 22:57:57,401 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): westus-0.in.applicationinsights.azure.com:443 +2025-05-20 22:57:57,663 DEBUG urllib3.connectionpool https://westus-0.in.applicationinsights.azure.com:443 "POST /v2.1/track HTTP/1.1" 200 None +2025-05-20 22:57:57,663 INFO azure.core.pipeline.policies.http_logging_policy Response status: 200 +Response headers: + 'Transfer-Encoding': 'chunked' + 'Content-Type': 'application/json; charset=utf-8' + 'Server': 'Microsoft-HTTPAPI/2.0' + 'Strict-Transport-Security': 'REDACTED' + 'X-Content-Type-Options': 'REDACTED' + 'Date': 'Tue, 20 May 2025 22:57:56 GMT' +Hello, World! +2025-05-20 22:57:57,666 INFO azure.core.pipeline.policies.http_logging_policy Request URL: 'https://eastus-8.in.applicationinsights.azure.com//v2.1/track' +Request method: 'POST' +Request headers: + 'Content-Type': 'application/json' + 'Content-Length': '1610' + 'Accept': 'application/json' + 'x-ms-client-request-id': 'df22f14e-35cd-11f0-a616-3bc028b7fd3a' + 'User-Agent': 'azsdk-python-azuremonitorclient/unknown Python/3.10.12 (Linux-6.5.0-1025-azure-x86_64-with-glibc2.35)' +A body is sent with the request +2025-05-20 22:57:57,667 DEBUG urllib3.connectionpool Starting new HTTPS connection (1): eastus-8.in.applicationinsights.azure.com:443 +2025-05-20 22:57:57,742 DEBUG urllib3.connectionpool https://eastus-8.in.applicationinsights.azure.com:443 "POST /v2.1/track HTTP/1.1" 200 None +2025-05-20 22:57:57,742 INFO azure.core.pipeline.policies.http_logging_policy Response status: 200 +Response headers: + 'Transfer-Encoding': 'chunked' + 'Content-Type': 'application/json; charset=utf-8' + 'Server': 'Microsoft-HTTPAPI/2.0' + 'Strict-Transport-Security': 'REDACTED' + 'X-Content-Type-Options': 'REDACTED' + 'Date': 'Tue, 20 May 2025 22:57:56 GMT' +2025-05-20 22:57:57,743 INFO azure.monitor.opentelemetry.exporter.export._base Transmission succeeded: Item received: 2. Items accepted: 2 +2025-05-20 22:57:57,745 INFO azure.core.pipeline.policies.http_logging_policy Request URL: 'https://westus-0.in.applicationinsights.azure.com//v2.1/track' +Request method: 'POST' +Request headers: + 'Content-Type': 'application/json' + 'Content-Length': '1573' + 'Accept': 'application/json' + 'x-ms-client-request-id': 'df2ef098-35cd-11f0-a616-3bc028b7fd3a' + 'User-Agent': 'azsdk-python-azuremonitorclient/unknown Python/3.10.12 (Linux-6.5.0-1025-azure-x86_64-with-glibc2.35)' +A body is sent with the request +2025-05-20 22:57:57,745 DEBUG urllib3.connectionpool Starting new HTTPS connection (2): westus-0.in.applicationinsights.azure.com:443 +2025-05-20 22:57:58,001 DEBUG urllib3.connectionpool https://westus-0.in.applicationinsights.azure.com:443 "POST /v2.1/track HTTP/1.1" 200 None +2025-05-20 22:57:58,001 INFO azure.core.pipeline.policies.http_logging_policy Response status: 200 +Response headers: + 'Transfer-Encoding': 'chunked' + 'Content-Type': 'application/json; charset=utf-8' + 'Server': 'Microsoft-HTTPAPI/2.0' + 'Strict-Transport-Security': 'REDACTED' + 'X-Content-Type-Options': 'REDACTED' + 'Date': 'Tue, 20 May 2025 22:57:57 GMT' +``` + +Sample code: +``` +""" +An example to show an application using Opentelemetry tracing api and sdk. Custom dependencies are +tracked via spans and telemetry is exported to application insights with the AzureMonitorTraceExporter. +""" + +import os +from opentelemetry import trace +from opentelemetry.sdk.trace import TracerProvider +from opentelemetry.sdk.trace.export import BatchSpanProcessor +from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter +import logging + +# Enable detailed debug logging for Azure Monitor and OpenTelemetry +logging.basicConfig( + level=logging.DEBUG, + format="%(asctime)s %(levelname)s %(name)s %(message)s", +) +# Increase verbosity for key components +for logger_name in [ + "azure.monitor.opentelemetry", + "azure.core.pipeline.policies.http_logging_policy", + "azure.monitor.opentelemetry.exporter", + "opentelemetry", + "opentelemetry.sdk.trace", + "opentelemetry.sdk.trace.export", +]: + logging.getLogger(logger_name).setLevel(logging.DEBUG) + +tracer_provider = TracerProvider() +trace.set_tracer_provider(tracer_provider) +tracer = trace.get_tracer(__name__) +# This is the exporter that sends data to Application Insights +exporter = AzureMonitorTraceExporter( + connection_string="InstrumentationKey=c0b360fa-422d-40e5-b8a9-d642578f9fce;IngestionEndpoint=https://eastus-8.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus.livediagnostics.monitor.azure.com/;ApplicationId=087d527c-b60e-4346-a679-f6abf367d0f0" +) +span_processor = BatchSpanProcessor(exporter) +trace.get_tracer_provider().add_span_processor(span_processor) + +with tracer.start_as_current_span("hello"): + print("Hello, World!") + +# Telemetry records are flushed automatically upon application exit +# If you would like to flush records manually yourself, you can call force_flush() +tracer_provider.force_flush() +``` + +## answer +The traces table in appinsights is populated by the logging exporter. See examples here-> (azure-sdk-for-python/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/logs at main · Azure/azure-sdk-for-python)[https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-opentelemetry-exporter/samples/logs] + +If you want your data from your spans in app insights, they would appear in the requests/dependncies table in appinsights depending on if you are making outbound or inbound requests. You can view your span attributes being mappedin custom dimensions field in appinsights. Please refer to the official documentation -> (Microsoft OpenTelemetry exporter for Azure Monitor | Microsoft Learn)[https://learn.microsoft.com/en-us/python/api/overview/azure/monitor-opentelemetry-exporter-readme?view=azure-python-preview] + +Please keep in mind that using the exporter directly is experimental but it seems like your use case is specific in nature that you need to work with the components itself instead of via the distro? + +# Failed to start record + +## question +Hi team, I was getting internal server error from test-proxy when I tried to run tests on a commit of main branch. The following shows the local variables in the scope of `tools\azure-sdk-tools\devtools_testutils\proxy_testcase.py#L91`. +``` +result.auto_close = True +result.chunk_left = None +result.chunked = False +result.closed = True +result.connection = None +result.data = b'' +result.decode_content = True +result.enforce_content_length = True +result.headers = HTTPHeaderDict({'Content-Length': '0', 'Date': 'Tue, 13 Mar 2025 10:59:00 GMT'}) +result.length_remaining = 0 +result.msg = None +result.reason = 'Internal Server Error' +result.retries = Retry(total=3, connect=None, read=None, redirect=None, status=None) +result.status = 500 +result.url = '/record/start' +result.version = 11 +result.version_string = 'HTTP/1.1' +result._body = b'' +``` +The following text is the error message. +``` +:\Source\Repos\azure-sdk-for-python\sdk\webpubsub\azure-messaging-webpubsubservice\tests\test_reverse_proxy.py::TestWebpubsubReverseProxy::test_reverse_proxy_call failed: args = (,) +kwargs = {'__aggregate_cache_key': ('EnvironmentVariableLoader',), 'webpubsub_connection_string': 'Endpoint=https://wps-prod-se...ps-prod-seasia.webpubsub.azure.com', 'webpubsub_reverse_proxy_endpoint': 'https://wps-prod-seasia.webpubsub.azure.com'} +trimmed_kwargs = {'webpubsub_connection_string': 'Endpoint=https://wps-prod-seasia.webpubsub.azure.com;AccessKey=;Version=1.0;', 'webpubsub_reverse_proxy_endpoint': 'https://wps-prod-seasia.webpubsub.azure.com'} +test_id = 'sdk/webpubsub/azure-messaging-webpubsubservice/tests/recordings/test_reverse_proxy.pyTestWebpubsubReverseProxytest_reverse_proxy_call' + + def record_wrap(*args, **kwargs): + def transform_args(*args, **kwargs): + copied_positional_args = list(args) + request = copied_positional_args[1] + + transform_request(request, recording_id) + + return tuple(copied_positional_args), kwargs + + trimmed_kwargs = {k: v for k, v in kwargs.items()} + trim_kwargs_from_test_function(test_func, trimmed_kwargs) + + if is_live_and_not_recording(): + return test_func(*args, **trimmed_kwargs) + + test_id = get_test_id() +> recording_id, variables = start_record_or_playback(test_id) + +tools\azure-sdk-tools\devtools_testutils\proxy_testcase.py:194: +_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ + +test_id = 'sdk/webpubsub/azure-messaging-webpubsubservice/tests/recordings/test_reverse_proxy.pyTestWebpubsubReverseProxytest_reverse_proxy_call' + + def start_record_or_playback(test_id: str) -> "Tuple[str, Dict[str, str]]": + """Sends a request to begin recording or playing back the provided test. + + This returns a tuple, (a, b), where a is the recording ID of the test and b is the `variables` dictionary that maps + test variables to values. If no variable dictionary was stored when the test was recorded, b is an empty dictionary. + """ + variables = {} # this stores a dictionary of test variable values that could have been stored with a recording + + json_payload = {"x-recording-file": test_id} + assets_json = get_recording_assets(test_id) + if assets_json: + json_payload["x-recording-assets-file"] = assets_json + + encoded_payload = json.dumps(json_payload).encode("utf-8") + http_client = get_http_client() + + if is_live(): + result = http_client.request( + method="POST", + url=RECORDING_START_URL, + body=encoded_payload, + ) + if result.status != 200: + message = six.ensure_str(result.data) +> raise HttpResponseError(message=message) +E azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'None' + +tools\azure-sdk-tools\devtools_testutils\proxy_testcase.py:93: HttpResponseError +``` + +The commit is 7f659e62a6689e45276f75255b3fb9fcf8fbba1f +To reproduce the issue, try run the test in `sdk\webpubsub\azure-messaging-webpubsubservice\tests` in live test mode. Any troubleshooting guide for the test-proxy? + +## answer +It's absolutely a conflict with the repo assuming you will always have an assets.json tag present. So when it attempts to restore a tag that doesn't exist, it crashes. + +I definitely think that we can improve the error handling to make this a bit more visible to you. On proxy output side it's readily visible. + +So. For you. I would recommend the following to unblock yourself. +1. in your env or active shell session, set PROXY_URL=http://localhost:5000. I have reason to believe that we have an issue with newer versions of the async libraries over default https certificate +2. delete your .assets folder, then update your assets.json to the following content before rerunning your tests +``` +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "python", + "TagPrefix": "python/webpubsub/azure-messaging-webpubsubservice", + "Tag": "" +} +``` + +Once you successfully record new recordings, test-proxy push and your Tag will be properly populated. diff --git a/QA/skip_question.json b/QA/skip_question.json index f4cadb1c8ff8..9da76d191e7e 100644 --- a/QA/skip_question.json +++ b/QA/skip_question.json @@ -32,6 +32,14 @@ { "question": "Merge to main pipeline fail for macos311 without showing errors", "reason": "Bug issue." + }, + { + "question": "Generated code does not output the raw error.", + "reason": "Bug issue." + }, + { + "question": "tsp-client update failed when generating Python SDK", + "reason": "Bug issue." }, { "question": "Unable to Trigger SDK Generation Pipeline", From 22cd190ab0fc27c68255efe87c9988d2c3885c3b Mon Sep 17 00:00:00 2001 From: "Chenxi Jiang (WICRESOFT NORTH AMERICA LTD)" Date: Wed, 6 Aug 2025 17:42:46 +0800 Subject: [PATCH 5/7] update qas --- QA/{python-0806.md => python-0529.md} | 99 ++++++++++++++++++++++++++- QA/python-0626.md | 8 +++ QA/python-0710.md | 24 ++++++- QA/{python-0805.md => python-0807.md} | 22 ------ QA/skip_question.json | 40 ++++++++--- 5 files changed, 161 insertions(+), 32 deletions(-) rename QA/{python-0806.md => python-0529.md} (62%) rename QA/{python-0805.md => python-0807.md} (76%) diff --git a/QA/python-0806.md b/QA/python-0529.md similarity index 62% rename from QA/python-0806.md rename to QA/python-0529.md index f022446e486f..e82240fe7cc5 100644 --- a/QA/python-0806.md +++ b/QA/python-0529.md @@ -2,7 +2,7 @@ ## question Hi there, I am trying to try to use the (Azure Monitor OTEL Exporter)[https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-opentelemetry-exporter#microsoft-opentelemetry-exporter-for-azure-monitor] for a python application, and I am having trouble getting data flow when I follow the examples of setting up the exporter. I tried to copy the (hello world sample code)[https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/monitor/azure-monitor-opentelemetry-exporter#export-hello-world-trace] and put my connection string, and I'm still not seeing any tracing data land in my traces table in my App Insights instance. Could I get some help here to figure out what is going on, or where the sample code might not be functional? - + I tried to look through the debug logs: ``` 2025-05-20 22:57:57,387 DEBUG urllib3.connectionpool Starting new HTTP connection (1): 169.254.169.254:80 @@ -228,3 +228,100 @@ So. For you. I would recommend the following to unblock yourself. ``` Once you successfully record new recordings, test-proxy push and your Tag will be properly populated. + +# Question Regarding Regression in Python SDK v11.0.0 for Container Registry + +## question +Hi Language - Python, I'm from the Azure Container Registry team, and we have a question regarding one of the recent SDK releases. + +The release in question is v11.0.0 ([AutoRelease] t2-containerregistry-2024-12-10-60943(can only be merged by SDK owner) by azure-sdk · Pull Request #38810 · Azure/azure-sdk-for-python), which was generated based on this Swagger PR Savaradh containerregistry microsoft.container registry 2024 11 01 preview new by savaradh · Pull Request #31612 · Azure/azure-rest-api-specs + +We recently noticed a regression in version 11.0.0: Previously, the _create_initial method returned a deserialized Task object, but in v11.0.0, it now returns a streamed response. This change was not mentioned in the changelog. + +Additionally, our Swagger PR did not modify the 2019-06-01-preview/containerregistry_build.json file, so we're unsure why the SDK PR includes changes to these operation files. + +In the "removed" lines (lines 503-507 in red), there was code that did: +``` +if response.status_code == 200: + deserialized = self._deserialize("Task", pipeline_response) +if response.status_code == 201: + deserialized = self._deserialize("Task", pipeline_response) +``` +But in the current version (line 496 in green), it's doing: +``` +deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) +``` + +Could someone help us understand the root cause of this issue? Any insights would be greatly appreciated. Thanks + +## answer +This was a change made in the code generator a while ago, and it's basically an implementation detail change in the public generated code. `_create_initial` is a private method that is used to set up the initial call to start the polling in `begin_create`. We just switched over our initial calls to not do premature deserialization, and there is 0 customer impact. Hope this clears stuff up! + +# OOB Stable Python SDK + +## question +Hi Language - Python team, I'm trying to release Python SDK here: https://github.com/Azure/sdk-release-request/issues/6124 which is required to test and release Azure CLI module. Given that CLI has a deadline of next week for code complete, I have a couple of questions around this: + +1. Can this SDK be released out of band ASAP? +2. For future iterations, what's the process we should take to align with CLI releases, so that we have enough time to release SDKs and then release CLI as well? +Thanks + +## answer +1. SDK team will release this package in advance to unblock CLI. Add Chenxi Jiang (WICRESOFT NORTH AMERICA LTD) for awareness. +2. If CLI module depends on SDK, it is better to make release request issue earlier so that SDK team could prepare the release in advance. + +# GA review + +## question +Hi all, we're looking to release our first stable Python SDK in (Deid GA release by jovinson-ms · Pull Request #40850 · Azure/azure-sdk-for-python)[https://github.com/Azure/azure-sdk-for-python/pull/40850]. Would appreciate a look at the APIView, as we pulled in some suggested client customization from Java and .NET reviews but would like feedback on whether they are idiomatic to Python. + +## answer +Hi, I would recommend making a post in the (Language - Python - Reviews)[https://teams.microsoft.com/l/channel/19%3A4175567f1e154a80ab5b88cbd22ea92f%40thread.skype/Language%20-%20Python%20-%20Reviews?groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47] channel + +# Changelog release requirements + +## question +Hi all, I'm trying to release our data plane SDK's first stable version in (Deid GA release by jovinson-ms · Pull Request #40850 · Azure/azure-sdk-for-python)[https://github.com/Azure/azure-sdk-for-python/pull/40850]. I'm getting (build failures on changelog validation)[https://dev.azure.com/azure-sdk/public/_build/results?buildId=4824427&view=logs&j=b70e5e73-bbb6-5567-0939-8415943fadb9&t=ac8f4042-9b76-5db4-27b1-2a4abaa9bb3c&l=101]. Looking through the docs, I don't see any changelog update process for data plane in contrast to the control plane automation. Can someone help me understand what the process is here? + +## answer +You didn't update the base version of the package! Appears to still be `1.0.0b1` +I believe it should be `1.0.0` to match the changelog you added + +# CSpell config + +## question +Hi all, I know there are common CSpell config settings as .vscode/cspell.json. I also see a few package-level cspell config files checked in: (Code search results)[https://github.com/search?q=repo%3AAzure%2Fazure-sdk-for-python+path%3Acspell.json&type=code]. Is there some config that needs to be set for pipelines to use local cspell config? + +## answer +We haven't done this in the SDK repos yet but we intend to allow folks to inherit from the root file. Similar to https://github.com/Azure/azure-rest-api-specs/blob/main/specification/communication/cspell.yaml where it imports the root cspell config. So as long as you inherit it should work. + +# Disable Pylint checks on .pyi files + +## question +Hi all, + +Storage is adding .pyi files for each of our clients to move `kwargs` to named keywords without having to make massive changes to our runtime code. We have noticed that pylint still runs on these .pyi files and a lot of the checks just don't make sense there, for example `super-init-not-called`. Obviously super init would not be called in a stub. + +Example PR: ([Storage] [Named Keywords] [Blob] `_container_client.pyi` and aio by weirongw23-msft · Pull Request #41030 · Azure/azure-sdk-for-python)[https://github.com/Azure/azure-sdk-for-python/pull/41030/files] + +This is causing us to have to put in a bunch of pylint disables. Curious on everyone's thoughts on simply disabling pylint on stub files entirely? + +## answer +You could consider using `Unpack` with `TypedDict` to handle the typing of kwargs? In the long term it would probably be a lower maintenance solution (it also allows the addition of documentation in intellisense prompts - which the current pyi file doesn't seem to have). +Here's an example if you want to have a read through: +(azure-sdk-for-python/sdk/projects/azure-projects/azure/projects/resources/storage/_resource.py at main · Azure/azure-sdk-for-python)[https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/projects/azure-projects/azure/projects/resources/storage/_resource.py#L237-L243] + +# Python Storage SDK - `walk_blobs` API + +## question +Hi Anna and Kashif Khan, + +(A customer mentioned)[https://github.com/Azure/azure-sdk-for-python/issues/40873] that `walk_blobs` API could return `BlobPrefix` where the current rtype is just `BlobProperties`. Based on this feedback, it appears that `walk_blob` needs to have rtype `BlobProperties | BlobPrefix` ((PR)[https://github.com/Azure/azure-sdk-for-python/pull/40931]). However, this would be a breaking change to our customers, and it would be harder to work with as the customer needs to type check themselves, so not great. + +In .NET, `GetBlobsByHierarchy` (returns a custom type)[https://github.com/Azure/azure-sdk-for-net/blob/6ee19685b3c1ecc7f9d7b6318954b12708dcc179/sdk/storage/Azure.Storage.Blobs/src/BlobContainerClient.cs#L2713-L2773] of `Pageable` which has a Boolean value to check whether the item is `BlobPrefix` or `BlobProperties`. + +We'd like some feedback on how to best proceed here. Thanks! + +## answer +To clarify, changing the type hint is not a breaking change, just annoying to work with a Union return type. The other options of introducing a wrapper class however, would be breaking obviously. +If this is already acting that way at runtime, it means people already use `isintance` or `try/except AttributeError` anyway, so the `Union` still make things better. diff --git a/QA/python-0626.md b/QA/python-0626.md index 529e0727bc1b..05c7eeea2fa3 100644 --- a/QA/python-0626.md +++ b/QA/python-0626.md @@ -94,3 +94,11 @@ Once this PR passes: https://github.com/Azure/azure-sdk-for-python/pull/41724 You can pull from main and try regenerating. Let me know if you see any diffs in regeneration and if these diffs work out for you. + +# Releasing Python SDK + +## question +Hello Language - Python, I wanted to release a new version of my team's SDK in GA using the release planner, I wanted to ask if I had to manually run the ADO pipeline for it here (Run release SDK pipeline)[https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-pipeline] + +## answer +Since this is an ARM service, you should talk to Yuchao about the process diff --git a/QA/python-0710.md b/QA/python-0710.md index 6c1f84c73ac3..800f754cab9c 100644 --- a/QA/python-0710.md +++ b/QA/python-0710.md @@ -17,4 +17,26 @@ The AgentsClientOperationsMixin class should not be documented or publicly expos After discussion, the Python SDK team concluded that the correct solution is to make the mixin operation group a private class. This change ensures the class is hidden from public documentation while maintaining compatibility with the generated code. -The issue has been tracked in https://github.com/microsoft/typespec/issues/7803, and the fix has been implemented in https://github.com/microsoft/typespec/pull/7817. \ No newline at end of file +The issue has been tracked in https://github.com/microsoft/typespec/issues/7803, and the fix has been implemented in https://github.com/microsoft/typespec/pull/7817. + +# Entitlement Required for SDK Generation Pipeline Access + +## question +Hi team, + +I'm currently working on generating the Python SDK using the pipeline: (Using the SDK generation pipelines)[https://eng.ms/docs/products/azure-developer-experience/develop/sdk-generation-pipelines]. Although I have write access to the related GitHub repositories, I’m unable to access the pipeline itself. +Could you please let me know which entitlement is required for this access? Thank you! + +## answer +https://aka.ms/azsdk/access +``` +You'll need a GitHub account to contribute to Azure REST API and SDK repositories. Before you get started, be sure that you also: + +Join the Microsoft organization on GitHub. +Join the Azure organization. +Check the visibility of your Microsoft and Azure org memberships. + +If you're working on branches in the main repo for your spec, or working in the Azure SDK repositories to submit pull requests or serving as the support contact for issues, you'll need write access so that you can apply or dismiss labels, create or modify issues, and assign issues to others. It also allows you to add/update test recordings in the test assets repo. + +To get access to Azure SDK repos, request to join the (Azure SDK Partners)[https://aka.ms/azsdk/join/azuresdkpartners] and have the request approved by your manager. After your manager approves, it may take up to one day for you to automatically be added to the (azure-sdk-partners)[https://github.com/orgs/Azure/teams/azure-sdk-partners] GitHub team. This will get you write access to all Azure SDK related repos. These membership requests will need to be renewed every 180 days. +``` diff --git a/QA/python-0805.md b/QA/python-0807.md similarity index 76% rename from QA/python-0805.md rename to QA/python-0807.md index 7da0ba0d2a37..78ae4c1da3b3 100644 --- a/QA/python-0805.md +++ b/QA/python-0807.md @@ -82,25 +82,3 @@ resource_client = ResourceManagementClient( credential, subscription_id, cloud_setting=resource_manager, ``` - -# Entitlement Required for SDK Generation Pipeline Access - -## question -Hi team, - -I'm currently working on generating the Python SDK using the pipeline: (Using the SDK generation pipelines)[https://eng.ms/docs/products/azure-developer-experience/develop/sdk-generation-pipelines]. Although I have write access to the related GitHub repositories, I’m unable to access the pipeline itself. -Could you please let me know which entitlement is required for this access? Thank you! - -## answer -https://aka.ms/azsdk/access -``` -You'll need a GitHub account to contribute to Azure REST API and SDK repositories. Before you get started, be sure that you also: - -Join the Microsoft organization on GitHub. -Join the Azure organization. -Check the visibility of your Microsoft and Azure org memberships. - -If you're working on branches in the main repo for your spec, or working in the Azure SDK repositories to submit pull requests or serving as the support contact for issues, you'll need write access so that you can apply or dismiss labels, create or modify issues, and assign issues to others. It also allows you to add/update test recordings in the test assets repo. - -To get access to Azure SDK repos, request to join the (Azure SDK Partners)[https://aka.ms/azsdk/join/azuresdkpartners] and have the request approved by your manager. After your manager approves, it may take up to one day for you to automatically be added to the (azure-sdk-partners)[https://github.com/orgs/Azure/teams/azure-sdk-partners] GitHub team. This will get you write access to all Azure SDK related repos. These membership requests will need to be renewed every 180 days. -``` diff --git a/QA/skip_question.json b/QA/skip_question.json index 9da76d191e7e..8fb6e17a2b34 100644 --- a/QA/skip_question.json +++ b/QA/skip_question.json @@ -7,12 +7,32 @@ }, { "question": "BreakingChange-Python-SDK review", - "reason": "Review request." + "reason": "BreakingChange review request." + }, + { + "question": "https://teams.microsoft.com/l/message/19:b97d98e6d22c41e0970a1150b484d935@thread.skype/1747406803200?tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47&groupId=3e17dcb0-4257-4a30-b843-77f47f1d4121&parentMessageId=1747406803200&teamName=Azure%20SDK&channelName=Language%20-%20Python&createdTime=1747406803200", + "reason": "BreakingChange review request." + }, + { + "question": "Need Breaking change approval for Python", + "reason": "BreakingChange review request." + }, + { + "question": "Hanging on: urllib3.connectionpool: Starting new HTTPS connection (1)", + "reason": "Bug issue." + }, + { + "question": "Python generator produces mismatched model-alias in `_operations.py` after adding ServicePatterns module", + "reason": "Bug issue." }, { "question": "Generate code cause too-many-locals and Unused import urllib.parse", "reason": "Bug issue." }, + { + "question": "Python sdk generation failure post merging the latest changes from main", + "reason": "Bug issue." + }, { "question": "Code generator on python validates versions by comparing literals.", "reason": "Bug issue." @@ -46,12 +66,20 @@ "reason": "No further resolution needed." }, { - "question": "Releasing Python SDK", + "question": "Updating python repo to Ubuntu-24.04", "reason": "No further resolution needed." }, { - "question": "Updating python repo to Ubuntu-24.04", - "reason": "No further resolution needed." + "question": "Fail to record test only async", + "reason": "No clear resolution." + }, + { + "question": "Streaming response timeouts when using azure-ai-agents library", + "reason": "No clear resolution." + }, + { + "question": "Security CodeQL items from Azure SDK", + "reason": "No clear resolution." }, { "question": "Secret env var handling", @@ -64,10 +92,6 @@ { "question": "Playback mode not working in the pipeline", "reason": "No outcome for more than a month." - }, - { - "question": "Streaming response timeouts when using azure-ai-agents library", - "reason": "No outcome for more than a month." } ] } From a64603becb03bd83250e2930a932b016987e6d23 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 <119990644+ChenxiJiang333@users.noreply.github.com> Date: Wed, 6 Aug 2025 17:46:54 +0800 Subject: [PATCH 6/7] Update python-0724.md --- QA/python-0724.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/QA/python-0724.md b/QA/python-0724.md index cad35844e2ac..92f6d8246cb4 100644 --- a/QA/python-0724.md +++ b/QA/python-0724.md @@ -1,3 +1,90 @@ +# tsp-client update failed when generating Python SDK + +## question +Hi team, +I've updated my TypeSpec PR (link: [[Conv Authoring] modify Python clientname 20250515preview](https://github.com/Azure/azure-rest-api-specs/pull/36074)) and am using the latest commit ID to generate the Python SDK via `tsp-client update`. However, the command consistently fails with the following error: +``` +npm warn cleanup Failed to remove some directories [ +npm warn cleanup [ +npm warn cleanup '\\\\?\\C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec\\compiler', +npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@typespec\compiler\dist\src\core'] { +npm warn cleanup errno: -4048, +npm warn cleanup code: 'EPERM', +npm warn cleanup syscall: 'rmdir', +npm warn cleanup path: 'C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec\\compiler\\dist\\src\\core' +npm warn cleanup } +npm warn cleanup ], +npm warn cleanup [ +npm warn cleanup '\\\\?\\C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec', +npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@typespec\http-client-python\generator\build\lib\pygen\codegen'] { +npm warn cleanup errno: -4048, +npm warn cleanup code: 'EPERM', +npm warn cleanup syscall: 'rmdir', +npm warn cleanup path: 'C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec\\http-client-python\\generator\\build\\lib\\pygen\\codegen' +npm warn cleanup } +npm warn cleanup ], +npm warn cleanup [ +npm warn cleanup '\\\\?\\C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec\\http-client-python', +npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@typespec\http-client-python\venv\Lib\site-packages\pip\_vendor'] { +npm warn cleanup errno: -4048, +npm warn cleanup code: 'EPERM', +npm warn cleanup syscall: 'rmdir', +npm warn cleanup path: 'C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@typespec\\http-client-python\\venv\\Lib\\site-packages\\pip\\_vendor' +npm warn cleanup } +npm warn cleanup ], +npm warn cleanup [ +npm warn cleanup '\\\\?\\C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@azure-tools', +npm warn cleanup [Error: EPERM: operation not permitted, rmdir 'C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@azure-tools\typespec-python\venv'] { +npm warn cleanup errno: -4048, +npm warn cleanup code: 'EPERM', +npm warn cleanup syscall: 'rmdir', +npm warn cleanup path: 'C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@azure-tools\\typespec-python\\venv' +npm warn cleanup } +npm warn cleanup ] +npm warn cleanup ] +npm error code 1 +npm error path C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@azure-tools\typespec-python +npm error command failed +npm error command C:\WINDOWS\system32\cmd.exe /d /s /c tsx ./scripts/run-python3.ts ./scripts/install.py +npm error Traceback (most recent call last): +npm error File "C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@azure-tools\typespec-python\scripts\install.py", line 46, in +npm error main() +npm error ~~~~^^ +npm error File "C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@azure-tools\typespec-python\scripts\install.py", line 39, in main +npm error venv_context = create_venv_with_package_manager(venv_path) +npm error File "C:\Users\v-amberchen\source\repos\azure-sdk-for-python\sdk\cognitivelanguage\azure-ai-language-conversations-authoring\TempTypeSpecFiles\node_modules\@azure-tools\typespec-python\scripts\package_manager.py", line 140, in create_venv_with_package_manager +npm error env_builder.create(venv_path) +npm error ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^ +npm error File "C:\Users\v-amberchen\AppData\Local\Programs\Python\Python313\Lib\venv\__init__.py", line 82, in create +npm error self._setup_pip(context) +npm error ~~~~~~~~~~~~~~~^^^^^^^^^ +npm error File "C:\Users\v-amberchen\AppData\Local\Programs\Python\Python313\Lib\venv\__init__.py", line 446, in _setup_pip +npm error self._call_new_python(context, '-m', 'ensurepip', '--upgrade', +npm error ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +npm error '--default-pip', stderr=subprocess.STDOUT) +npm error ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +npm error File "C:\Users\v-amberchen\AppData\Local\Programs\Python\Python313\Lib\venv\__init__.py", line 442, in _call_new_python +npm error subprocess.check_output(args, **kwargs) +npm error ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ +npm error File "C:\Users\v-amberchen\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 472, in check_output +npm error return run(*popenargs, stdout=PIPE, timeout=timeout, check=True, +npm error ~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +npm error **kwargs).stdout +npm error ^^^^^^^^^ +npm error File "C:\Users\v-amberchen\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 577, in run +npm error raise CalledProcessError(retcode, process.args, +npm error output=stdout, stderr=stderr) +npm error subprocess.CalledProcessError: Command '['C:\\Users\\v-amberchen\\source\\repos\\azure-sdk-for-python\\sdk\\cognitivelanguage\\azure-ai-language-conversations-authoring\\TempTypeSpecFiles\\node_modules\\@azure-tools\\typespec-python\\venv\\Scripts\\python.exe', '-m', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1. +npm error Error: Command failed: py -3 ./scripts/install.py +npm error A complete log of this run can be found in: C:\Users\v-amberchen\AppData\Local\npm-cache\_logs\2025-07-21T22_34_40_381Z-debug-0.log +update +``` +I've checked my Python installation `ensurepip` is satisfied, tried manually deleting the `TempTypeSpecFiles` folder or running the command in an Administrator terminal.... +But the issue still persists. Has anyone encountered this before or could share some insights? Any help would be much appreciated. Thank you! + +## answer +Maybe you could try install "uv" (here is guidance [Installation | uv](https://docs.astral.sh/uv/getting-started/installation/)) as a workaround and sync with latest main branch of python sdk repo then try again. I have created an issue ([python] install failure with `pip` · Issue #8113 · microsoft/typespec)[https://github.com/microsoft/typespec/issues/8113] to track it. + # The date for the changelog being released must be the latest in the file. ## question From 06e3b7893b49d4b88595d43cc291801fef7f4d22 Mon Sep 17 00:00:00 2001 From: "Chenxi Jiang (WICRESOFT NORTH AMERICA LTD)" Date: Wed, 6 Aug 2025 17:58:51 +0800 Subject: [PATCH 7/7] update --- QA/skip_question.json | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/QA/skip_question.json b/QA/skip_question.json index 8fb6e17a2b34..2f77d1c007ff 100644 --- a/QA/skip_question.json +++ b/QA/skip_question.json @@ -19,47 +19,43 @@ }, { "question": "Hanging on: urllib3.connectionpool: Starting new HTTPS connection (1)", - "reason": "Bug issue." + "reason": "Bug report." }, { "question": "Python generator produces mismatched model-alias in `_operations.py` after adding ServicePatterns module", - "reason": "Bug issue." + "reason": "Bug report." }, { "question": "Generate code cause too-many-locals and Unused import urllib.parse", - "reason": "Bug issue." + "reason": "Bug report." }, { "question": "Python sdk generation failure post merging the latest changes from main", - "reason": "Bug issue." + "reason": "Bug report." }, { "question": "Code generator on python validates versions by comparing literals.", - "reason": "Bug issue." + "reason": "Bug report." }, { "question": "How to make code gen to generate `AgentsOperations` instead of `AgentsClientOperationsMixin`", - "reason": "Bug issue." + "reason": "Bug report." }, { "question": "API View Displays Incorrect Python Package Name", - "reason": "Bug issue." + "reason": "Bug report." }, { "question": "Incorrect client used in generated samples", - "reason": "Bug issue." + "reason": "Bug report." }, { - "question": "Merge to main pipeline fail for macos311 without showing errors", - "reason": "Bug issue." - }, - { "question": "Generated code does not output the raw error.", - "reason": "Bug issue." + "reason": "Bug report." }, { "question": "tsp-client update failed when generating Python SDK", - "reason": "Bug issue." + "reason": "Bug report." }, { "question": "Unable to Trigger SDK Generation Pipeline", @@ -69,6 +65,10 @@ "question": "Updating python repo to Ubuntu-24.04", "reason": "No further resolution needed." }, + { + "question": "Merge to main pipeline fail for macos311 without showing errors", + "reason": "No further resolution needed." + }, { "question": "Fail to record test only async", "reason": "No clear resolution."