From eff9e9175d07f1ca4cd41f77cb7ac2b5a498ffef Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 26 Jan 2026 14:46:25 -0800 Subject: [PATCH 1/6] fix pyright --- .../authoring/_utils/serialization.py | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/serialization.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/serialization.py index e81921cbb011..afbd30990e3a 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/serialization.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/serialization.py @@ -787,7 +787,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -821,13 +821,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1757,7 +1764,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises TypeError: if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1783,7 +1790,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): @@ -2027,4 +2038,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - return date_obj + return date_obj \ No newline at end of file From 758ae8d23386c74111cfa3ae2b03a811fb5acd48 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 26 Jan 2026 15:02:23 -0800 Subject: [PATCH 2/6] updapted samples --- .../azure-ai-textanalytics-authoring/dev_requirements.txt | 3 ++- .../async/sample_assign_deployment_resources_async.py | 2 +- .../samples/async/sample_authentication_async.py | 6 +++--- .../samples/async/sample_cancel_training_job_async.py | 2 +- .../samples/async/sample_create_project_async.py | 2 +- .../samples/async/sample_delete_deployment_async.py | 2 +- .../samples/async/sample_delete_project_async.py | 2 +- .../samples/async/sample_delete_trained_model_async.py | 2 +- .../samples/async/sample_deploy_project_async.py | 2 +- .../samples/async/sample_export_project_async.py | 2 +- .../samples/async/sample_get_deployment_async.py | 2 +- .../async/sample_get_model_evaluation_summary_async.py | 2 +- .../samples/async/sample_get_project_async.py | 2 +- .../samples/async/sample_import_project_async.py | 2 +- .../async/sample_list_model_evaluation_results_async.py | 2 +- .../samples/async/sample_load_snapshot_async.py | 2 +- .../samples/async/sample_swap_deployments_async.py | 2 +- .../samples/async/sample_train_project_async.py | 2 +- .../async/sample_unassign_deployment_resources_async.py | 2 +- .../samples/sample_authentication.py | 6 +++--- .../tests/test_cancel_training_job.py | 1 - .../tests/test_cancel_training_job_async.py | 1 - .../tests/test_delete_deployment.py | 1 - .../tests/test_delete_deployment_async.py | 1 - .../tests/test_deploy_project.py | 2 +- .../tests/test_deploy_project_async.py | 2 +- 26 files changed, 27 insertions(+), 30 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/dev_requirements.txt b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/dev_requirements.txt index 0e53b6a72db5..f5df333868ec 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/dev_requirements.txt +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/dev_requirements.txt @@ -1,3 +1,4 @@ -e ../../../eng/tools/azure-sdk-tools ../../core/azure-core -aiohttp \ No newline at end of file +aiohttp +azure-identity \ No newline at end of file diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_assign_deployment_resources_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_assign_deployment_resources_async.py index ed5708bbec45..82ca09eade4d 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_assign_deployment_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_assign_deployment_resources_async.py @@ -29,7 +29,7 @@ # [START text_authoring_assign_deployment_resources_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient from azure.ai.textanalytics.authoring.models import ( diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_authentication_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_authentication_async.py index 5edc28089c30..2a63cb57b53c 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_authentication_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_authentication_async.py @@ -41,11 +41,11 @@ async def sample_authentication_api_key_async(): endpoint = os.environ["AZURE_TEXT_ENDPOINT"] key = os.environ["AZURE_TEXT_KEY"] - text_client = TextAuthoringClient(endpoint, AzureKeyCredential(key)) + text_client = TextAuthoringClient(endpoint, AzureKeyCredential(key)) # pylint:disable=unused-variable # [END create_text_client_with_key_async] -async def sample_authentication_with_azure_active_directory(): +async def sample_authentication_with_aad(): """DefaultAzureCredential will use the values from these environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET """ @@ -56,7 +56,7 @@ async def sample_authentication_with_azure_active_directory(): endpoint = os.environ["AZURE_TEXT_ENDPOINT"] credential = DefaultAzureCredential() - text_client = TextAuthoringClient(endpoint, credential=credential) + text_client = TextAuthoringClient(endpoint, credential=credential) # pylint:disable=unused-variable async def main(): diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_cancel_training_job_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_cancel_training_job_async.py index a83b4c19f4b1..8ea7e96c6821 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_cancel_training_job_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_cancel_training_job_async.py @@ -27,7 +27,7 @@ # [START text_authoring_cancel_training_job_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.ai.textanalytics.authoring.aio import TextAuthoringClient diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_create_project_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_create_project_async.py index e5b9cf3e92ab..afc67fa3b5da 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_create_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_create_project_async.py @@ -29,7 +29,7 @@ # [START text_authoring_create_project_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.ai.textanalytics.authoring.aio import TextAuthoringClient from azure.ai.textanalytics.authoring.models import ( CreateProjectOptions, diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_deployment_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_deployment_async.py index 6a79ca7c0f5f..2482950953d3 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_deployment_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_deployment_async.py @@ -27,7 +27,7 @@ # [START text_authoring_delete_deployment_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_project_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_project_async.py index 05ab2a747021..a276fd491238 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_project_async.py @@ -26,7 +26,7 @@ # [START text_authoring_delete_project_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_trained_model_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_trained_model_async.py index 6861eab5656d..78dca69b6500 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_trained_model_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_delete_trained_model_async.py @@ -28,7 +28,7 @@ import os import asyncio from azure.core.exceptions import HttpResponseError -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.ai.textanalytics.authoring.aio import TextAuthoringClient diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_deploy_project_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_deploy_project_async.py index 47acfab22dd9..290c19c97ad8 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_deploy_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_deploy_project_async.py @@ -28,7 +28,7 @@ # [START text_authoring_deploy_project_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient from azure.ai.textanalytics.authoring.models import CreateDeploymentDetails diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_export_project_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_export_project_async.py index e22c925b5664..3ca406f0af5f 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_export_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_export_project_async.py @@ -26,7 +26,7 @@ # [START text_authoring_export_project_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient from azure.ai.textanalytics.authoring.models import StringIndexType diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_deployment_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_deployment_async.py index 1f6063980aa7..b0f30f3483a3 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_deployment_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_deployment_async.py @@ -27,7 +27,7 @@ # [START text_authoring_get_deployment_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.ai.textanalytics.authoring.aio import TextAuthoringClient diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py index 8932b1aac1ea..d9a3003d211c 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py @@ -29,7 +29,7 @@ # [START text_authoring_get_model_evaluation_summary_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.ai.textanalytics.authoring.aio import TextAuthoringClient from azure.ai.textanalytics.authoring.models import ( CustomSingleLabelClassificationEvalSummary, diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_project_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_project_async.py index 594e77895311..3b0da601ad83 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_project_async.py @@ -26,7 +26,7 @@ # [START text_authoring_get_project_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.ai.textanalytics.authoring.aio import TextAuthoringClient diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_import_project_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_import_project_async.py index 121daa9c32e0..40cfd6912cbb 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_import_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_import_project_async.py @@ -30,7 +30,7 @@ # [START text_authoring_import_project_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient from azure.ai.textanalytics.authoring.models import ( diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py index bc851656acde..6cbb4d16866a 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py @@ -28,7 +28,7 @@ # [START text_authoring_get_model_evaluation_results_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.ai.textanalytics.authoring.aio import TextAuthoringClient from azure.ai.textanalytics.authoring.models import ( CustomSingleLabelClassificationDocumentEvalResult, diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_load_snapshot_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_load_snapshot_async.py index 81b491d68db6..cdfb7859323d 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_load_snapshot_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_load_snapshot_async.py @@ -27,7 +27,7 @@ # [START text_authoring_load_snapshot_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_swap_deployments_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_swap_deployments_async.py index 30affb7dcd70..5597d5ebefde 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_swap_deployments_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_swap_deployments_async.py @@ -28,7 +28,7 @@ # [START text_authoring_swap_deployments_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient from azure.ai.textanalytics.authoring.models import SwapDeploymentsDetails diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_train_project_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_train_project_async.py index bbf1b379728e..e737acdbaae9 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_train_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_train_project_async.py @@ -28,7 +28,7 @@ # [START text_authoring_train_project_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient from azure.ai.textanalytics.authoring.models import ( diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py index 3b9a46c32a9c..1d1d7f209136 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py @@ -27,7 +27,7 @@ # [START text_authoring_unassign_deployment_resources_async] import os import asyncio -from azure.identity import DefaultAzureCredential +from azure.identity.aio import DefaultAzureCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient from azure.ai.textanalytics.authoring.models import ( diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/sample_authentication.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/sample_authentication.py index e51396386310..686dc6e764c7 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/sample_authentication.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/sample_authentication.py @@ -41,11 +41,11 @@ def sample_authentication_api_key(): endpoint = os.environ["AZURE_TEXT_ENDPOINT"] key = os.environ["AZURE_TEXT_KEY"] - text_client = TextAuthoringClient(endpoint, AzureKeyCredential(key)) + text_client = TextAuthoringClient(endpoint, AzureKeyCredential(key)) # pylint:disable=unused-variable # [END create_text_client_with_key] -def sample_authentication_with_azure_active_directory(): +def sample_authentication_with_aad(): """DefaultAzureCredential will use the values from these environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET """ @@ -56,7 +56,7 @@ def sample_authentication_with_azure_active_directory(): endpoint = os.environ["AZURE_TEXT_ENDPOINT"] credential = DefaultAzureCredential() - text_client = TextAuthoringClient(endpoint, credential=credential) + text_client = TextAuthoringClient(endpoint, credential=credential) # pylint:disable=unused-variable def main(): diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_cancel_training_job.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_cancel_training_job.py index 52c2fa358707..82a85340695a 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_cancel_training_job.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_cancel_training_job.py @@ -4,7 +4,6 @@ from devtools_testutils import AzureRecordedTestCase, EnvironmentVariableLoader, recorded_by_proxy from azure.core.credentials import AzureKeyCredential from azure.ai.textanalytics.authoring import TextAuthoringClient -from azure.ai.textanalytics.authoring.models import TrainingJobResult ConversationsPreparer = functools.partial( EnvironmentVariableLoader, diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_cancel_training_job_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_cancel_training_job_async.py index c1f3585aecec..3fdf918c0099 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_cancel_training_job_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_cancel_training_job_async.py @@ -1,6 +1,5 @@ # pylint: disable=line-too-long,useless-suppression import functools -import json import pytest from devtools_testutils import AzureRecordedTestCase, EnvironmentVariableLoader diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_delete_deployment.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_delete_deployment.py index e7c85f9951c2..1b849919d85e 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_delete_deployment.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_delete_deployment.py @@ -5,7 +5,6 @@ from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring import TextAuthoringClient -from azure.ai.textanalytics.authoring.models import DeploymentState ConversationsPreparer = functools.partial( EnvironmentVariableLoader, diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_delete_deployment_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_delete_deployment_async.py index 0abd75fd2d12..8dc263e4855f 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_delete_deployment_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_delete_deployment_async.py @@ -7,7 +7,6 @@ from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient -from azure.ai.textanalytics.authoring.models import DeploymentState ConversationsPreparer = functools.partial( EnvironmentVariableLoader, diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_deploy_project.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_deploy_project.py index 677008c5e89a..2fbc29a31b57 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_deploy_project.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_deploy_project.py @@ -5,7 +5,7 @@ from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring import TextAuthoringClient -from azure.ai.textanalytics.authoring.models import CreateDeploymentDetails, DeploymentState +from azure.ai.textanalytics.authoring.models import CreateDeploymentDetails ConversationsPreparer = functools.partial( EnvironmentVariableLoader, diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_deploy_project_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_deploy_project_async.py index 5ae4cee1409f..94f04dde6973 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_deploy_project_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/tests/test_deploy_project_async.py @@ -7,7 +7,7 @@ from azure.core.credentials import AzureKeyCredential from azure.core.exceptions import HttpResponseError from azure.ai.textanalytics.authoring.aio import TextAuthoringClient -from azure.ai.textanalytics.authoring.models import CreateDeploymentDetails, DeploymentState +from azure.ai.textanalytics.authoring.models import CreateDeploymentDetails ConversationsPreparer = functools.partial( EnvironmentVariableLoader, From 23ed22bc09c86a35748b5fbbc1593e45ce53ff2f Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 26 Jan 2026 15:08:01 -0800 Subject: [PATCH 3/6] updated async samples --- .../async/sample_get_model_evaluation_summary_async.py | 4 ++-- .../async/sample_list_model_evaluation_results_async.py | 4 ++-- .../async/sample_unassign_deployment_resources_async.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py index d9a3003d211c..d275b7b6068b 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py @@ -36,7 +36,7 @@ ) -async def sample_get_model_evaluation_summary_async(): +async def sample_get_model_eval_summary_async(): # settings endpoint = os.environ["AZURE_TEXT_ENDPOINT"] project_name = os.environ.get("PROJECT_NAME", "") @@ -98,7 +98,7 @@ async def sample_get_model_evaluation_summary_async(): async def main(): - await sample_get_model_evaluation_summary_async() + await sample_get_model_eval_summary_async() if __name__ == "__main__": diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py index 6cbb4d16866a..b8e02f6ce909 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py @@ -36,7 +36,7 @@ ) -async def sample_list_model_evaluation_results_async(): +async def sample_list_model_eval_results_async(): # settings endpoint = os.environ["AZURE_TEXT_ENDPOINT"] project_name = os.environ.get("PROJECT_NAME", "") @@ -73,7 +73,7 @@ async def sample_list_model_evaluation_results_async(): async def main(): - await sample_list_model_evaluation_results_async() + await sample_list_model_eval_results_async() if __name__ == "__main__": diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py index 1d1d7f209136..e58c9fc6b919 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py @@ -35,7 +35,7 @@ ) -async def sample_unassign_deployment_resources_async(): +async def sample_unassign_deploy_resources_async(): # settings endpoint = os.environ["AZURE_TEXT_AUTHORING_ENDPOINT"] project_name = os.environ.get("PROJECT_NAME", "") @@ -66,7 +66,7 @@ async def sample_unassign_deployment_resources_async(): async def main(): - await sample_unassign_deployment_resources_async() + await sample_unassign_deploy_resources_async() if __name__ == "__main__": From f474b7f14f4e128f7967582bb0de3cf99a9cb152 Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 26 Jan 2026 15:16:01 -0800 Subject: [PATCH 4/6] fix model_base --- .../authoring/_utils/model_base.py | 133 ++++++++++++++++-- .../authoring/_utils/serialization.py | 2 +- 2 files changed, 122 insertions(+), 13 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/model_base.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/model_base.py index 430bda7b37fc..097f8197cfd9 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/model_base.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/model_base.py @@ -22,7 +22,7 @@ from datetime import datetime, date, time, timedelta, timezone from json import JSONEncoder import xml.etree.ElementTree as ET -from collections.abc import MutableMapping # pylint:disable=import-error +from collections.abc import MutableMapping from typing_extensions import Self import isodate from azure.core.exceptions import DeserializationError @@ -37,6 +37,7 @@ TZ_UTC = timezone.utc _T = typing.TypeVar("_T") +_NONE_TYPE = type(None) def _timedelta_as_isostr(td: timedelta) -> str: @@ -171,6 +172,21 @@ def default(self, o): # pylint: disable=too-many-return-statements r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" ) +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: """Deserialize ISO-8601 formatted string into Datetime object. @@ -202,7 +218,7 @@ def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: test_utc = date_obj.utctimetuple() if test_utc.tm_year > 9999 or test_utc.tm_year < 1: raise OverflowError("Hit max or min date") - return date_obj + return date_obj # type: ignore[no-any-return] def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: @@ -256,7 +272,7 @@ def _deserialize_time(attr: typing.Union[str, time]) -> time: """ if isinstance(attr, time): return attr - return isodate.parse_time(attr) + return isodate.parse_time(attr) # type: ignore[no-any-return] def _deserialize_bytes(attr): @@ -315,6 +331,8 @@ def _deserialize_int_as_str(attr): def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): if annotation is int and rf and rf._format == "str": return _deserialize_int_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) if rf and rf._format: return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore @@ -353,9 +371,39 @@ def __contains__(self, key: typing.Any) -> bool: return key in self._data def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized return self._data.__getitem__(key) def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass self._data.__setitem__(key, value) def __delitem__(self, key: str) -> None: @@ -483,6 +531,8 @@ def _is_model(obj: typing.Any) -> bool: def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) return [_serialize(x, format) for x in o] if isinstance(o, dict): return {k: _serialize(v, format) for k, v in o.items()} @@ -638,15 +688,29 @@ def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: if not rf._rest_name_input: rf._rest_name_input = attr cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._backcompat_attr_to_rest_field: dict[str, _RestField] = { + Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf + for attr, rf in cls._attr_to_rest_field.items() + } cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") - return super().__new__(cls) # pylint:disable=no-value-for-parameter + return super().__new__(cls) def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: for base in cls.__bases__: if hasattr(base, "__mapping__"): base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + @classmethod + def _get_backcompat_attribute_name(cls, attr_to_rest_field: dict[str, "_RestField"], attr_name: str) -> str: + rest_field_obj = attr_to_rest_field.get(attr_name) # pylint: disable=protected-access + if rest_field_obj is None: + return attr_name + original_tsp_name = getattr(rest_field_obj, "_original_tsp_name", None) # pylint: disable=protected-access + if original_tsp_name: + return original_tsp_name + return attr_name + @classmethod def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: for v in cls.__dict__.values(): @@ -767,6 +831,17 @@ def _deserialize_sequence( return obj if isinstance(obj, ET.Element): obj = list(obj) + try: + if ( + isinstance(obj, str) + and isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ): + # encoded string may be deserialized to sequence + return deserializer(obj) + except: # pylint: disable=bare-except + pass return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) @@ -817,16 +892,16 @@ def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-retur # is it optional? try: - if any(a for a in annotation.__args__ if a == type(None)): # pyright: ignore + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore if len(annotation.__args__) <= 2: # pyright: ignore if_obj_deserializer = _get_deserialize_callable_from_annotation( - next(a for a in annotation.__args__ if a != type(None)), module, rf # pyright: ignore + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore ) return functools.partial(_deserialize_with_optional, if_obj_deserializer) # the type is Optional[Union[...]], we need to remove the None type from the Union annotation_copy = copy.copy(annotation) - annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a != type(None)] # pyright: ignore + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) except AttributeError: pass @@ -972,6 +1047,7 @@ def _failsafe_deserialize_xml( return None +# pylint: disable=too-many-instance-attributes class _RestField: def __init__( self, @@ -984,6 +1060,7 @@ def __init__( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, ): self._type = type self._rest_name_input = name @@ -995,10 +1072,15 @@ def __init__( self._format = format self._is_multipart_file_input = is_multipart_file_input self._xml = xml if xml is not None else {} + self._original_tsp_name = original_tsp_name @property def _class_type(self) -> typing.Any: - return getattr(self._type, "args", [None])[0] + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result @property def _rest_name(self) -> str: @@ -1009,14 +1091,37 @@ def _rest_name(self) -> str: def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin # by this point, type and rest_name will have a value bc we default # them in __new__ of the Model class - item = obj.get(self._rest_name) + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name) if item is None: return item if self._is_model: return item - return _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + if value is None: # we want to wipe out entries if users set attr to None try: @@ -1046,6 +1151,7 @@ def rest_field( format: typing.Optional[str] = None, is_multipart_file_input: bool = False, xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, ) -> typing.Any: return _RestField( name=name, @@ -1055,6 +1161,7 @@ def rest_field( format=format, is_multipart_file_input=is_multipart_file_input, xml=xml, + original_tsp_name=original_tsp_name, ) @@ -1184,7 +1291,7 @@ def _get_wrapped_element( _get_element(v, exclude_readonly, meta, wrapped_element) else: wrapped_element.text = _get_primitive_type_value(v) - return wrapped_element + return wrapped_element # type: ignore[no-any-return] def _get_primitive_type_value(v) -> str: @@ -1197,7 +1304,9 @@ def _get_primitive_type_value(v) -> str: return str(v) -def _create_xml_element(tag, prefix=None, ns=None): +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: if prefix and ns: ET.register_namespace(prefix, ns) if ns: diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/serialization.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/serialization.py index afbd30990e3a..81ec1de5922b 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/serialization.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/azure/ai/textanalytics/authoring/_utils/serialization.py @@ -2038,4 +2038,4 @@ def deserialize_unix(attr): except ValueError as err: msg = "Cannot deserialize to unix datetime object." raise DeserializationError(msg) from err - return date_obj \ No newline at end of file + return date_obj From d9061ab47838ebaeec525a92e204ab26736e43cc Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Wed, 28 Jan 2026 14:57:44 -0800 Subject: [PATCH 5/6] updated --- .../async/sample_get_model_evaluation_summary_async.py | 6 +++--- .../async/sample_list_model_evaluation_results_async.py | 5 +++-- .../async/sample_unassign_deployment_resources_async.py | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py index d275b7b6068b..4a1287eacd31 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_get_model_evaluation_summary_async.py @@ -1,4 +1,4 @@ -# pylint: disable=line-too-long,useless-suppression +# pylint: disable=name-too-long, line-too-long, useless-suppression # coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft. @@ -36,7 +36,7 @@ ) -async def sample_get_model_eval_summary_async(): +async def sample_get_model_evaluation_summary_async(): # settings endpoint = os.environ["AZURE_TEXT_ENDPOINT"] project_name = os.environ.get("PROJECT_NAME", "") @@ -98,7 +98,7 @@ async def sample_get_model_eval_summary_async(): async def main(): - await sample_get_model_eval_summary_async() + await sample_get_model_evaluation_summary_async() if __name__ == "__main__": diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py index b8e02f6ce909..08f7db9359d0 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_list_model_evaluation_results_async.py @@ -1,3 +1,4 @@ +# pylint: disable=name-too-long,useless-suppression # coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft. @@ -36,7 +37,7 @@ ) -async def sample_list_model_eval_results_async(): +async def sample_list_model_evaluation_results_async(): # settings endpoint = os.environ["AZURE_TEXT_ENDPOINT"] project_name = os.environ.get("PROJECT_NAME", "") @@ -73,7 +74,7 @@ async def sample_list_model_eval_results_async(): async def main(): - await sample_list_model_eval_results_async() + await sample_list_model_evaluation_results_async() if __name__ == "__main__": diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py index e58c9fc6b919..81f19f5a0444 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/samples/async/sample_unassign_deployment_resources_async.py @@ -1,3 +1,4 @@ +# pylint: disable=name-too-long,useless-suppression # coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. @@ -35,7 +36,7 @@ ) -async def sample_unassign_deploy_resources_async(): +async def sample_unassign_deployment_resources_async(): # settings endpoint = os.environ["AZURE_TEXT_AUTHORING_ENDPOINT"] project_name = os.environ.get("PROJECT_NAME", "") @@ -66,7 +67,7 @@ async def sample_unassign_deploy_resources_async(): async def main(): - await sample_unassign_deploy_resources_async() + await sample_unassign_deployment_resources_async() if __name__ == "__main__": From 7c6ff06a6a38163d969af62c6e9a9956ef7b2fba Mon Sep 17 00:00:00 2001 From: "Amber Chen (Centific Technologies Inc)" Date: Mon, 2 Feb 2026 10:30:04 -0800 Subject: [PATCH 6/6] updated --- .../azure-ai-textanalytics-authoring/dev_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/dev_requirements.txt b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/dev_requirements.txt index f5df333868ec..396f26f367a1 100644 --- a/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/dev_requirements.txt +++ b/sdk/cognitivelanguage/azure-ai-textanalytics-authoring/dev_requirements.txt @@ -1,4 +1,4 @@ -e ../../../eng/tools/azure-sdk-tools ../../core/azure-core aiohttp -azure-identity \ No newline at end of file +../../identity/azure-identity \ No newline at end of file