From dcf2e48749fc6d413b4c2a12f6e5850d4194283b Mon Sep 17 00:00:00 2001 From: Jose Arriaga Maldonado <45773732+joseharriaga@users.noreply.github.com> Date: Wed, 17 May 2023 17:25:08 -0700 Subject: [PATCH] [Text Analytics] Remove test that depended on a retired model version (#36343) --- .../tests/ExtractKeyPhrasesTests.cs | 14 ---- .../ExtractKeyPhrasesWithWarningTest.json | 73 ------------------- ...ExtractKeyPhrasesWithWarningTestAsync.json | 73 ------------------- 3 files changed, 160 deletions(-) delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesWithWarningTest.json delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesWithWarningTestAsync.json diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/ExtractKeyPhrasesTests.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/ExtractKeyPhrasesTests.cs index a4562d228ff54..d7a3047191e19 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/ExtractKeyPhrasesTests.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/ExtractKeyPhrasesTests.cs @@ -81,20 +81,6 @@ public async Task ExtractKeyPhrasesWithLanguageTest() Assert.IsTrue(keyPhrases.Contains("veterinario")); } - [RecordedTest] - public async Task ExtractKeyPhrasesWithWarningTest() - { - TextAnalyticsClient client = GetClient(); - string document = "Anthony runs his own personal training business so thisisaverylongtokenwhichwillbetruncatedtoshowushowwarningsareemittedintheapi"; - - ExtractKeyPhrasesResultCollection keyPhrasesCollection = await client.ExtractKeyPhrasesBatchAsync(new List { document }, "es", new TextAnalyticsRequestOptions() { ModelVersion = "2020-07-01" }); - KeyPhraseCollection keyPhrases = keyPhrasesCollection.FirstOrDefault().KeyPhrases; - - ValidateInDocumenResult(keyPhrases, 1); - - Assert.AreEqual(TextAnalyticsWarningCode.LongWordsInDocument, keyPhrases.Warnings.FirstOrDefault().WarningCode.ToString()); - } - [RecordedTest] public async Task ExtractKeyPhrasesBatchWithErrorTest() { diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesWithWarningTest.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesWithWarningTest.json deleted file mode 100644 index fda4d4ceb1293..0000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesWithWarningTest.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://javatextanalyticstestresources.cognitiveservices.azure.com/language/:analyze-text?api-version=2022-10-01-preview\u0026showStats=false", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Content-Length": "270", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-888ff0675e21a938c5631512712c9a22-c7a0ea529745eaf4-00", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.3.0-alpha.20221014.1 (.NET 6.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "cc96e6bc308a85d6736243ca60708115", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "analysisInput": { - "documents": [ - { - "id": "0", - "text": "Anthony runs his own personal training business so thisisaverylongtokenwhichwillbetruncatedtoshowushowwarningsareemittedintheapi", - "language": "es" - } - ] - }, - "parameters": { - "modelVersion": "2020-07-01" - }, - "kind": "KeyPhraseExtraction" - }, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "0bcf3ed3-47d8-486c-8722-9678a757c708", - "Content-Length": "445", - "Content-Type": "application/json; charset=utf-8", - "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=1,CognitiveServices.TextAnalytics.TextRecords=1", - "Date": "Fri, 14 Oct 2022 22:16:59 GMT", - "Set-Cookie": ".AspNetCore.Mvc.CookieTempDataProvider=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax; httponly", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "18" - }, - "ResponseBody": { - "kind": "KeyPhraseExtractionResults", - "results": { - "documents": [ - { - "id": "0", - "keyPhrases": [ - "own personal training business", - "Anthony runs", - "thisisaverylongtokenwhichwillbetruncatedtoshowushowwarningsareem" - ], - "warnings": [ - { - "code": "LongWordsInDocument", - "message": "The document contains very long words (longer than 64 characters). These words will be truncated and may result in unreliable model predictions." - } - ] - } - ], - "errors": [], - "modelVersion": "2020-07-01" - } - } - } - ], - "Variables": { - "RandomSeed": "2010927502", - "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://javatextanalyticstestresources.cognitiveservices.azure.com" - } -} diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesWithWarningTestAsync.json b/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesWithWarningTestAsync.json deleted file mode 100644 index 1e3269bf45923..0000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/tests/SessionRecords/ExtractKeyPhrasesTests/ExtractKeyPhrasesWithWarningTestAsync.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "Entries": [ - { - "RequestUri": "https://javatextanalyticstestresources.cognitiveservices.azure.com/language/:analyze-text?api-version=2022-10-01-preview\u0026showStats=false", - "RequestMethod": "POST", - "RequestHeaders": { - "Accept": "application/json", - "Content-Length": "270", - "Content-Type": "application/json", - "Ocp-Apim-Subscription-Key": "Sanitized", - "traceparent": "00-9f57379ec7d51659e4afd478f1e9d305-8472ab030121db47-00", - "User-Agent": "azsdk-net-AI.TextAnalytics/5.3.0-alpha.20221014.1 (.NET 6.0.10; Microsoft Windows 10.0.22621)", - "x-ms-client-request-id": "4f78d003fccbfadf887bcfb4df1010b0", - "x-ms-return-client-request-id": "true" - }, - "RequestBody": { - "analysisInput": { - "documents": [ - { - "id": "0", - "text": "Anthony runs his own personal training business so thisisaverylongtokenwhichwillbetruncatedtoshowushowwarningsareemittedintheapi", - "language": "es" - } - ] - }, - "parameters": { - "modelVersion": "2020-07-01" - }, - "kind": "KeyPhraseExtraction" - }, - "StatusCode": 200, - "ResponseHeaders": { - "apim-request-id": "2ad6e4ca-9993-461b-b389-75ab861b5392", - "Content-Length": "445", - "Content-Type": "application/json; charset=utf-8", - "csp-billing-usage": "CognitiveServices.TextAnalytics.BatchScoring=1,CognitiveServices.TextAnalytics.TextRecords=1", - "Date": "Fri, 14 Oct 2022 22:17:00 GMT", - "Set-Cookie": ".AspNetCore.Mvc.CookieTempDataProvider=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/; samesite=lax; httponly", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains; preload", - "X-Content-Type-Options": "nosniff", - "x-envoy-upstream-service-time": "234" - }, - "ResponseBody": { - "kind": "KeyPhraseExtractionResults", - "results": { - "documents": [ - { - "id": "0", - "keyPhrases": [ - "own personal training business", - "Anthony runs", - "thisisaverylongtokenwhichwillbetruncatedtoshowushowwarningsareem" - ], - "warnings": [ - { - "code": "LongWordsInDocument", - "message": "The document contains very long words (longer than 64 characters). These words will be truncated and may result in unreliable model predictions." - } - ] - } - ], - "errors": [], - "modelVersion": "2020-07-01" - } - } - } - ], - "Variables": { - "RandomSeed": "1765825904", - "TEXT_ANALYTICS_API_KEY": "Sanitized", - "TEXT_ANALYTICS_ENDPOINT": "https://javatextanalyticstestresources.cognitiveservices.azure.com" - } -}