From a4cfd5e224cc1fc5b5e02286562bce2ccd2aa0fe Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Tue, 2 Mar 2021 14:44:17 -0800 Subject: [PATCH 1/2] temp disable sample tests until service bug fixed --- scripts/devops_tasks/test_run_samples.py | 4 ++++ .../samples/async_samples/sample_authentication_async.py | 6 +++--- .../samples/sample_authentication.py | 6 +++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/devops_tasks/test_run_samples.py b/scripts/devops_tasks/test_run_samples.py index bdfd518b41ab..95ddfec79cf9 100644 --- a/scripts/devops_tasks/test_run_samples.py +++ b/scripts/devops_tasks/test_run_samples.py @@ -79,6 +79,10 @@ "receive_deferred_message_queue_async.py", "receive_iterator_queue_async.py", "session_pool_receive_async.py" + ], + "azure-ai-formrecognizer": [ + "sample_recognize_receipts_from_url.py", + "sample_recognize_receipts_from_url_async.py" ] } diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_authentication_async.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_authentication_async.py index a1b1ac685d98..3c266c69db27 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_authentication_async.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/async_samples/sample_authentication_async.py @@ -37,7 +37,7 @@ class AuthenticationSampleAsync(object): - url = "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-receipt.png" + url = "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/forms/Form_1.jpg" async def authentication_with_api_key_credential_form_recognizer_client_async(self): # [START create_fr_client_with_key_async] @@ -49,7 +49,7 @@ async def authentication_with_api_key_credential_form_recognizer_client_async(se form_recognizer_client = FormRecognizerClient(endpoint, AzureKeyCredential(key)) # [END create_fr_client_with_key_async] async with form_recognizer_client: - poller = await form_recognizer_client.begin_recognize_receipts_from_url(self.url) + poller = await form_recognizer_client.begin_recognize_content_from_url(self.url) result = await poller.result() async def authentication_with_azure_active_directory_form_recognizer_client_async(self): @@ -66,7 +66,7 @@ async def authentication_with_azure_active_directory_form_recognizer_client_asyn form_recognizer_client = FormRecognizerClient(endpoint, credential) # [END create_fr_client_with_aad_async] async with form_recognizer_client: - poller = await form_recognizer_client.begin_recognize_receipts_from_url(self.url) + poller = await form_recognizer_client.begin_recognize_content_from_url(self.url) result = await poller.result() async def authentication_with_api_key_credential_form_training_client_async(self): diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_authentication.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_authentication.py index 1c1c1dcb872d..2f93e2a63421 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_authentication.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_authentication.py @@ -36,7 +36,7 @@ class AuthenticationSample(object): - url = "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-receipt.png" + url = "https://raw.githubusercontent.com/Azure/azure-sdk-for-python/master/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/forms/Form_1.jpg" def authentication_with_api_key_credential_form_recognizer_client(self): # [START create_fr_client_with_key] @@ -47,7 +47,7 @@ def authentication_with_api_key_credential_form_recognizer_client(self): form_recognizer_client = FormRecognizerClient(endpoint, AzureKeyCredential(key)) # [END create_fr_client_with_key] - poller = form_recognizer_client.begin_recognize_receipts_from_url(self.url) + poller = form_recognizer_client.begin_recognize_content_from_url(self.url) receipt = poller.result() def authentication_with_azure_active_directory_form_recognizer_client(self): @@ -63,7 +63,7 @@ def authentication_with_azure_active_directory_form_recognizer_client(self): form_recognizer_client = FormRecognizerClient(endpoint, credential) # [END create_fr_client_with_aad] - poller = form_recognizer_client.begin_recognize_receipts_from_url(self.url) + poller = form_recognizer_client.begin_recognize_content_from_url(self.url) receipt = poller.result() def authentication_with_api_key_credential_form_training_client(self): From 708b80c58313391a481a45eb31aac828e064ed2d Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Tue, 2 Mar 2021 15:03:44 -0800 Subject: [PATCH 2/2] change var name --- .../azure-ai-formrecognizer/samples/sample_authentication.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_authentication.py b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_authentication.py index 2f93e2a63421..ee21ddcec43c 100644 --- a/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_authentication.py +++ b/sdk/formrecognizer/azure-ai-formrecognizer/samples/sample_authentication.py @@ -48,7 +48,7 @@ def authentication_with_api_key_credential_form_recognizer_client(self): form_recognizer_client = FormRecognizerClient(endpoint, AzureKeyCredential(key)) # [END create_fr_client_with_key] poller = form_recognizer_client.begin_recognize_content_from_url(self.url) - receipt = poller.result() + result = poller.result() def authentication_with_azure_active_directory_form_recognizer_client(self): # [START create_fr_client_with_aad] @@ -64,7 +64,7 @@ def authentication_with_azure_active_directory_form_recognizer_client(self): form_recognizer_client = FormRecognizerClient(endpoint, credential) # [END create_fr_client_with_aad] poller = form_recognizer_client.begin_recognize_content_from_url(self.url) - receipt = poller.result() + result = poller.result() def authentication_with_api_key_credential_form_training_client(self): # [START create_ft_client_with_key]