diff --git a/QA/python-0529.md b/QA/python_2025_05_29.md similarity index 100% rename from QA/python-0529.md rename to QA/python_2025_05_29.md diff --git a/QA/python-0626.md b/QA/python_2025_06_26.md similarity index 100% rename from QA/python-0626.md rename to QA/python_2025_06_26.md diff --git a/QA/python-0703.md b/QA/python_2025_07_03.md similarity index 100% rename from QA/python-0703.md rename to QA/python_2025_07_03.md diff --git a/QA/python-0710.md b/QA/python_2025_07_10.md similarity index 100% rename from QA/python-0710.md rename to QA/python_2025_07_10.md diff --git a/QA/python-0717.md b/QA/python_2025_07_17.md similarity index 100% rename from QA/python-0717.md rename to QA/python_2025_07_17.md diff --git a/QA/python-0724.md b/QA/python_2025_07_24.md similarity index 100% rename from QA/python-0724.md rename to QA/python_2025_07_24.md diff --git a/QA/python-0731.md b/QA/python_2025_07_31.md similarity index 100% rename from QA/python-0731.md rename to QA/python_2025_07_31.md diff --git a/QA/python-0807.md b/QA/python_2025_08_07.md similarity index 100% rename from QA/python-0807.md rename to QA/python_2025_08_07.md diff --git a/QA/python_2025_08_14.md b/QA/python_2025_08_14.md new file mode 100644 index 000000000000..12adc09e6ff6 --- /dev/null +++ b/QA/python_2025_08_14.md @@ -0,0 +1,80 @@ +# SDK Failure blocking REST spec merge - Python + +## question +Not very clear, what I need to fix in the Spec for the SDK generation for Python to succeed +[Pipelines - Run 20250813.92 logs](https://dev.azure.com/azure-sdk/public/_build/results?buildId=5216426&view=logs&j=83516c17-6666-5250-abde-63983ce72a49&t=00be4b52-4a63-5865-8e02-c61723ad0692) +[Add Apimanagement 2024-10-01-preview by solankisamir · Pull Request #35659 · Azure/azure-rest-api-specs](https://github.com/Azure/azure-rest-api-specs/pull/35659/checks?check_run_id=48039897905) +``` +Errors occurred while generating SDK from specification/apimanagement/resource-manager/readme.md. Follow the steps at https://aka.ms/azsdk/sdk-automation-faq#how-to-view-the-detailed-sdk-generation-errors to view detailed errors. +2025-08-13 21:33:30 [ERROR] warning | DeprecatedConfig | Using directive.31.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:30 [ERROR] warning | DeprecatedConfig | Using directive.32.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:30 [ERROR] warning | DeprecatedConfig | Using directive.33.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:30 [ERROR] warning | DeprecatedConfig | Using directive.34.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:30 [ERROR] warning | DeprecatedConfig | Using directive.35.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:30 [ERROR] warning | DeprecatedConfig | Using directive.36.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:30 [ERROR] warning | DeprecatedConfig | Using directive.37.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:30 [ERROR] (node:13140) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead. +2025-08-13 21:33:30 [ERROR] (Use `node --trace-deprecation ...` to show where the warning was created) +2025-08-13 21:33:30 [ERROR] info | Installing AutoRest extension '@autorest/modelerfour' (4.27.0 -> 4.27.0) +2025-08-13 21:33:30 [ERROR] info | Installed AutoRest extension '@autorest/modelerfour' (4.27.0->4.27.0) +2025-08-13 21:33:30 [ERROR] info | Installing AutoRest extension '@autorest/python' (6.38.0 -> 6.38.0) +2025-08-13 21:33:30 [ERROR] info | Installed AutoRest extension '@autorest/python' (6.38.0->6.38.0) +2025-08-13 21:33:30 [ERROR] error | [Exception] No input files provided. +2025-08-13 21:33:30 [ERROR] +2025-08-13 21:33:30 [ERROR] Use --help to get help information or see https://aka.ms/autorest/cli for additional documentation +2025-08-13 21:33:30 [ERROR] error | Error: [Exception] No input files provided. +2025-08-13 21:33:30 [ERROR] +2025-08-13 21:33:30 [ERROR] Use --help to get help information or see https://aka.ms/autorest/cli for additional documentation +2025-08-13 21:33:30 [ERROR] error | Autorest completed with an error. If you think the error message is unclear, or is a bug, please declare an issues at https://github.com/Azure/autorest/issues with the error message you are seeing. +2025-08-13 21:33:32 [ERROR] warning | DeprecatedConfig | Using directive.27.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:32 [ERROR] warning | DeprecatedConfig | Using directive.28.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:32 [ERROR] warning | DeprecatedConfig | Using directive.29.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:32 [ERROR] warning | DeprecatedConfig | Using directive.30.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:32 [ERROR] warning | DeprecatedConfig | Using directive.31.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:32 [ERROR] warning | DeprecatedConfig | Using directive.32.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:32 [ERROR] warning | DeprecatedConfig | Using directive.33.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:32 [ERROR] warning | DeprecatedConfig | Using directive.34.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:32 [ERROR] warning | DeprecatedConfig | Using directive.35.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:32 [ERROR] warning | DeprecatedConfig | Using directive.36.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:32 [ERROR] warning | DeprecatedConfig | Using directive.37.suppress which is deprecated and will be removed in the future. +2025-08-13 21:33:32 [ERROR] info | Loading AutoRest extension '@autorest/modelerfour' (4.27.0->4.27.0) +2025-08-13 21:33:32 [ERROR] info | Loading AutoRest extension '@autorest/python' (6.38.0->6.38.0) +2025-08-13 21:33:32 [ERROR] error | [Exception] No input files provided. +2025-08-13 21:33:32 [ERROR] +2025-08-13 21:33:32 [ERROR] Use --help to get help information or see https://aka.ms/autorest/cli for additional documentation +2025-08-13 21:33:32 [ERROR] error | Error: [Exception] No input files provided. +2025-08-13 21:33:32 [ERROR] +2025-08-13 21:33:32 [ERROR] Use --help to get help information or see https://aka.ms/autorest/cli for additional documentation +2025-08-13 21:33:32 [ERROR] error | Autorest completed with an error. If you think the error message is unclear, or is a bug, please declare an issues at https://github.com/Azure/autorest/issues with the error message you are seeing. +2025-08-13 21:33:32 [ERROR] Fail to generate sdk for specification/apimanagement/resource-manager/readme.md: Command '['/mnt/vss/_work/1/s/azure-rest-api-specs/node_modules/.bin/autorest', '/mnt/vss/_work/1/s/azure-rest-api-specs/specification/apimanagement/resource-manager/readme.md', '--generate-sample=True', '--generate-test=True', '--include-x-ms-examples-original-file=True', '--keep-setup-py=True', '--python', '--python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk', '--use=@autorest/python@6.38.0', '--use=@autorest/modelerfour@4.27.0', '--version=3.10.2', '--version-tolerant=False']' returned non-zero exit status 1. +2025-08-13 21:33:32 [ERROR] ======================================= Whant Can I do (begin) ======================================================================== +2025-08-13 21:33:32 [ERROR] Fail to generate sdk for specification/apimanagement/resource-manager/readme.md. If you are from service team, please first check if the failure happens only to Python automation, or for all SDK automations. +2025-08-13 21:33:32 [ERROR] If it happens for all SDK automations, please double check your Swagger / Typespec, and check whether there is error in ModelValidation and LintDiff. +2025-08-13 21:33:32 [ERROR] If it happens to Python alone, you can open an issue to https://github.com/Azure/autorest.python/issues. Please include the link of this Pull Request in the issue. +2025-08-13 21:33:32 [ERROR] ======================================= Whant Can I do (end) ========================================================================= +Refer to the inner logs for details or report this issue through https://aka.ms/azsdk/support/specreview-channel. +ErrorStack: Error: [EXT-ERR] Failed to read generateOutput.json. Please check if the generate script is configured correctly. +``` + +## answer +```diff + - Microsoft.ApiManagement/stable/2024-05-01/apimworkspaces.json + - Microsoft.ApiManagement/stable/2024-05-01/definitions.json + - Microsoft.ApiManagement/stable/2024-05-01/operationStatuses.json +-tag: package-preview-2024-06 ++tag: package-preview-2024-10-01 +``` +I think this line is useless and may cause confusion. Please remove it. +```diff +title: ApiManagementClient +description: ApiManagement Client +openapi-type: arm +-tag: package-preview-2024-06 ++tag: package-preview-2024-10-01 +``` +New tag package-preview-2024-10-01-preview is added and I believe you want to use the new tag? +```diff +Suggested change +-tag: package-preview-2024-10-01 ++tag: package-preview-2024-10-01-preview +``` \ No newline at end of file diff --git a/QA/python_2025_08_21.md b/QA/python_2025_08_21.md new file mode 100644 index 000000000000..0a6c2b737e35 --- /dev/null +++ b/QA/python_2025_08_21.md @@ -0,0 +1,16 @@ +# Untitled + +## question +Hi Language - Python, +We're updating the Python SDK for the service `communication/azure-communication-messages` to include new changes using the 'tsp-client update' using a commit #. However, we do not want to include the changes in the TypeSpec specification from a previous commit since we don't want to release those to Python yet. +Is there a way to only include the latest changes and not the previous one to Python? + +Thanks + +## answer +Is there a SHA on Github on the RestAPI repo that represents exactly the API you want, and only that? Tsp-Client is cloning the RestAPI repo, so it cannot filter files based on anything else that git can express. + +Now, if you have APIs that are merged to main, but you don't want to ship them, you will need to define a custom cliennt.tsp file to explicitly list what you want to keep, and what you won't. + +If it is some API you do not want to include, you may try the @scope decorator in client.tsp +https://azure.github.io/typespec-azure/docs/libraries/typespec-client-generator-core/reference/decorators/#@Azure.ClientGenerator.Core.scope \ No newline at end of file diff --git a/QA/python_2025_08_29.md b/QA/python_2025_08_29.md new file mode 100644 index 000000000000..5e2d602bcf63 --- /dev/null +++ b/QA/python_2025_08_29.md @@ -0,0 +1,61 @@ +# Why is API version not applied when generating Python SDK with emitter? + +## question +Hi team, + +I have this TypeSpec PR: https://github.com/Azure/azure-rest-api-specs/blob/56fa17886b1cc3ed77c865e43f07152290367aac/specification/cognitiveservices/Language.AnalyzeText/main.tsp#L41, where I’ve added the `@versioned` decorator in `main.tsp` with multiple versions defined in an enum. + +However, the generated Python SDK does not include any version information — for example, in `_operations.py` there are no `@api_version_validation` decorators on the methods (see the PR link here: [[Textanalytics] Textanalytics sdk 20250515prevew by amber-Chen-86 · Pull Request #42685 · Azure/azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python/pull/42685)). + +The same TypeSpec setup works correctly for the .NET SDK, where versioning is properly recognized. +Do you know what might cause the Python emitter not to pick up the versioned information? Could this be related to having a different package name/namespace for Python? +Thank you so much! + +## answer +The reason you're not seeing @api_version_validation decorators in the generated Python SDK is because all your @added decorators are applied to models. In the Python emitter, we only apply version validation to operations and parameters, not models. This is intentional — models are parsed by the service, and we rely on the service to return appropriate error messages if a model is not valid for a given version. +The @api_version_validation decorators in Python SDK are used to provide runtime validation for operations or parameters that are version-specific. For example, if an operation like analyzeThis is introduced in API version 2025, and a customer configures the client with api_version="2024", without validation they would get a 404 error. With the decorator, they instead get a clearer message like: “This operation is only available after API version 2025 or higher.” +So yes, when you see versioning reflected in the Python SDK, it's typically because entire operations or parameters were added in a new version — not just models. Since your language-text API has the same routes across all versions and only models are versioned, it makes sense that you're not seeing version-specific validation in the Python SDK. + +# Pyright error in auto-generated _serialization.py (other packages) blocks my PR + +## question +Hi team, + +I’m hitting a Pyright failure in CI while merging a Python SDK PR. The error points to auto-generated files named `_serialization.py` in other packages (not the one I’m modifying): +``` +error: Cannot access attribute "_validation" for class "function" +``` +Details: https://dev.azure.com/azure-sdk/public/_build/results?buildId=5256165&view=logs&j=b70e5e73-bbb6-5567-0939-8415943fadb9&t=56d4e2e6-c43b-527c-bad7-234ebe7429dd&l=490 +``` +/mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_serialization.py + /mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_serialization.py:1586:52 - error: Cannot access attribute "_validation" for class "function" + Attribute "_validation" is unknown (reportFunctionMemberAccess) + /mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_serialization.py:1587:49 - error: Cannot access attribute "_validation" for class "function" + Attribute "_validation" is unknown (reportFunctionMemberAccess) + /mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/_serialization.py:1593:34 - error: Cannot assign to attribute "additional_properties" for class "object" + Attribute "additional_properties" is unknown (reportAttributeAccessIssue) +/mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/__init__.py + /mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/__init__.py:24:1 - warning: Operation on "__all__" is not supported, so exported symbol list may be incorrect (reportUnsupportedDunderAll) +/mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/_serialization.py + /mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/_serialization.py:1586:52 - error: Cannot access attribute "_validation" for class "function" + Attribute "_validation" is unknown (reportFunctionMemberAccess) + /mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/_serialization.py:1587:49 - error: Cannot access attribute "_validation" for class "function" + Attribute "_validation" is unknown (reportFunctionMemberAccess) + /mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/_serialization.py:1593:34 - error: Cannot assign to attribute "additional_properties" for class "object" + Attribute "additional_properties" is unknown (reportAttributeAccessIssue) +/mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/_operations/__init__.py + /mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/_operations/__init__.py:18:1 - warning: Operation on "__all__" is not supported, so exported symbol list may be incorrect (reportUnsupportedDunderAll) +/mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/aio/__init__.py + /mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/aio/__init__.py:21:1 - warning: Operation on "__all__" is not supported, so exported symbol list may be incorrect (reportUnsupportedDunderAll) +/mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/aio/_operations/__init__.py + /mnt/vss/_work/1/s/sdk/cognitivelanguage/azure-ai-language-questionanswering/azure/ai/language/questionanswering/authoring/aio/_operations/__init__.py:18:1 - warning: Operation on "__all__" is not supported, so exported symbol list may be incorrect (reportUnsupportedDunderAll) + +``` + +I merged `main` to pick up the latest changes, but the issue persists. +Any suggestions on how to resolve this? Thanks a lot! + +For reference: the PR link: [[Conv authoring] python sdk 20250515preview by amber-Chen-86 · Pull Request #42149 · Azure/azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python/pull/42149) + +## answer +your PR is about azure-ai-language-conversations while the CI failure is caused by another package azure-ai-language-questionanswering so the failure is not related with your PR. You could declare the context in your PR. \ No newline at end of file diff --git a/QA/python_2025_09_05.md b/QA/python_2025_09_05.md new file mode 100644 index 000000000000..922046470f4a --- /dev/null +++ b/QA/python_2025_09_05.md @@ -0,0 +1,49 @@ +# Untitled + +## question +Hello Language - Python +I have this PR [Improve typing by sofiar-msft · Pull Request #42596 · Azure/azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python/pull/42596) and I'm seeing these errors: +``` +2025-09-02T17:36:41.9509070Z ##[error]Invalid date [ 2025-08-28 ]. The date for the changelog being released must be the latest in the file. +2025-09-02T17:36:41.9509929Z ##[debug]Processed: ##vso[task.LogIssue type=error;]Invalid date [ 2025-08-28 ]. The date for the changelog being released must be the latest in the file. +2025-09-02T17:36:41.9588754Z ##[error]The changelog entry has the following sections with no content (Other Changes). Please ensure to either remove the empty sections or add content to the section. +``` +But our current changelog version has unreleased and I also do not see any empty section either so I'm not sure why is this failling. + +## answer +try updating the VERSIONconstant in azure/communication/phonenumbers/_version.py to also be 1.5.0. That might be throwing things off. + +# CI Checks Failing – Request for Guidance + +## question +Hi team, + +I have two PRs with failing CI checks that I haven’t been able to resolve, and I’d appreciate your help in understanding the issues. +PR 1: [[Conv authoring] python sdk 20250515preview by amber-Chen-86 · Pull Request #42149 · Azure/azure-sd…](https://github.com/Azure/azure-sdk-for-python/pull/42149) +Failing check: Analyze dependencies +Error details: https://dev.azure.com/azure-sdk/public/_build/results?buildId=5288707&view=logs&j=b70e5e73-bbb6-5567-0939-8415943fadb9&t=d31d5e2d-d8df-53bc-da94-87e19f5b2ee4&l=96 +``` +ERROR:root:Unable to parse metadata for package /mnt/vss/_work/1/s/sdk/storage/azure-storage, omitting from build. +ERROR:root:Unable to parse metadata for package /mnt/vss/_work/1/s/sdk/core/azure, omitting from build. +ERROR:root:Unable to parse metadata for package /mnt/vss/_work/1/s/sdk/core/azure-mgmt, omitting from build. +ERROR:root:Unable to parse metadata for package /mnt/vss/_work/1/s/sdk/monitor/azure-monitor, omitting from build. +``` +I’m not sure how to approach fixing this one. +PR 2: [[Textanalytics] Textanalytics sdk 20250515prevew by amber-Chen-86 · Pull Request #42685 · Azure/azu…](https://github.com/Azure/azure-sdk-for-python/pull/42685) +Failing check: Update Snippets +Error message: reports duplicate snippet names, e.g. text_extractive_summarization ([link: https://dev.azure.com/azure-sdk/public/_build/results?buildId=5293744&view=logs&j=b70e5e73-bbb6-5567-0939-8415943fadb9&t=b42a4c77-4205-522f-5a57-db739203b1a5&l=178]). +``` +Found duplicated snippet name "sample_extract_summary.text_extractive_summarization". +``` +However, I can only find one text_extractive_summarization snippet (with one start and one end) in this project. The same situation occurs with other supposed duplicates. +Could you please provide guidance on how to resolve these? Thank you! +Could you please take a look? How to resolve this error: https://dev.azure.com/azure-sdk/public/_build/results?buildId=5297612&view=logs&j=b70e5e73-bbb6-5567-0939-8415943fadb9&t=d31d5e2d-d8df-53bc-da94-87e19f5b2ee4&l=2384 + +This `azure-ai-language-conversationis` a hard dependency I was recommended to add for this authoring package. It is only for this package. But the error says it is not present in `shared_requirements.txt`. + +## answer +I think we just need to add to shared_requirements.txt: +[azure-sdk-for-python/shared_requirements.txt at main · Azure/azure-sdk-for-python](https://github.com/Azure/azure-sdk-for-python/blob/main/shared_requirements.txt) + +`azure-appconfiguration` and `azure-eventhub` are others example of this kind of extension package dependency. +It's definitely common across all packages. dependencies need to be approved before being added here and discussed with architects. diff --git a/QA/python_2025_09_12.md b/QA/python_2025_09_12.md new file mode 100644 index 000000000000..53a36868a6a0 --- /dev/null +++ b/QA/python_2025_09_12.md @@ -0,0 +1,49 @@ +# Python client operation groups + +## question +Hi Language - Python, + +We are trying to implement a feedback from the Python SDK architecture review for our service regarding moving from multiple clients to operation groups. + +As you can see in the screenshot below, the code samples are invalid. + +Original code from client.tsp: +``` +// === Ingestion Management === +#suppress "@azure-tools/typespec-azure-core/use-standard-operations" "This is an existing service operation." +@operationGroup +interface Ingestion { + // Ingestion operations management + deleteIngestionOperation is IngestionOperations.delete; + deleteAllIngestionOperations is IngestionOperations.deleteAll; + getIngestionOperation is IngestionOperations.get; + getIngestionOperations is IngestionOperations.list; + + // Ingestion runs operations + createIngestionRun is Ingestions.IngestionRuns.create; + getIngestionRun is Ingestions.IngestionRuns.get; + getIngestionRuns is Ingestions.IngestionRuns.list; +... +``` +And in the generated code sample, it uses `client.create` to call the operation `createIngestionRun`. + +I expect something like `client.ingestions.create_ingestion_run` rather than `client.create` + +I am not sure if I am missing something to generate the SDK with operation groups enabled. + +Is this a bug? + +Typespec generating from https://github.com/Azure/azure-rest-api-specs/pull/36381/files#diff-4f56a9c88a1f3e90c59eb780c8b240fa2f2680422d441564349b826632de3f5c + +## answer +do you guys explicitly want ingestions to be an initializable subclient on a main client, or do you want it to be a non-initializable subclient. The first case would allow you to directly initialize it, like in the sample code. For the second case, which is what `@operationGroup` gives you, you would instead call it like this `client.ingestions.create_ingestion_run`. + +If you want the first, I don't think your tsp is setup for this because it's not grouped by namespace in the regular typespec. For the second, you would just need to add +``` +@client({ + name: "PlanetaryComputerClient", + service: Microsoft.PlanetaryComputer, +}) +namespace Customizations; +``` +On top of your namespace in `client.tsp`. This would output an sdk where there was one top-level, initializable client, and each `@operationGroup` decorated interface would be its own non-initializable subclient, i.e. `client.ingestions.create_ingestion_run`