From b76aab17112fb60c73178b79293f47a6df95d678 Mon Sep 17 00:00:00 2001 From: Krista Pratico Date: Tue, 1 Feb 2022 11:33:26 -0800 Subject: [PATCH] fix spelling according to cspell (#22858) --- .vscode/cspell.json | 7 ++++++- .../azure/ai/translation/document/_client.py | 4 ++-- .../translation/document/aio/_client_async.py | 4 ++-- ...sample_translation_with_azure_blob_async.py | 2 +- .../sample_translation_with_azure_blob.py | 2 +- .../tests/asynctestcase.py | 2 +- .../tests/test_list_document_statuses.py | 18 +++++++++--------- .../tests/test_list_document_statuses_async.py | 18 +++++++++--------- .../tests/test_list_translations.py | 18 +++++++++--------- .../tests/test_list_translations_async.py | 18 +++++++++--------- .../tests/test_translation.py | 2 +- .../tests/test_translation_async.py | 2 +- .../tests/testcase.py | 2 +- 13 files changed, 52 insertions(+), 47 deletions(-) diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 1ae8b9cae0b7..a267e7df82b6 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -101,7 +101,8 @@ "sdk/videoanalyzer/azure-media-videoanalyzer-edge/**", "sdk/synapse/azure-synapse-artifacts/**", "sdk/webpubsub/azure-messaging-webpubsubservice/**", - "sdk/translation/azure-ai-translation-document/**", + "sdk/translation/azure-ai-translation-document/samples/assets/**", + "sdk/translation/azure-ai-translation-document/tests/glossaries-valid.csv", "sdk/tables/azure-data-tables/**", "sdk/textanalytics/azure-ai-textanalytics/**", "sdk/storage/azure-storage-blob/**", @@ -119,6 +120,8 @@ "adls", "aiohttp", "amqp", + "apim", + "Apim", "asyncio", "azcmagent", "azsdk", @@ -159,6 +162,7 @@ "imds", "inotify", "iohttp", + "inprogress", "ipconfiguration", "ipconfigurations", "iscoroutine", @@ -203,6 +207,7 @@ "pschema", "PSECRET", "pygobject", + "pytz", "pywin", "rdbms", "reauthenticated", diff --git a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_client.py b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_client.py index a3396b502904..1a107383d283 100644 --- a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_client.py +++ b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/_client.py @@ -252,7 +252,7 @@ def list_translation_statuses(self, **kwargs): :keyword int top: the total number of operations to return (across all pages) from all submitted translations. :keyword int skip: the number of operations to skip (from beginning of all submitted operations). - By default, we sort by all submitted operations descendingly by start time. + By default, we sort by all submitted operations in descending order by start time. :keyword int results_per_page: is the number of operations returned per page. :keyword list[str] translation_ids: translation operations ids to filter by. :keyword list[str] statuses: translation operation statuses to filter by. Options include @@ -324,7 +324,7 @@ def list_document_statuses(self, translation_id, **kwargs): :param str translation_id: ID of translation operation to list documents for. :keyword int top: the total number of documents to return (across all pages). :keyword int skip: the number of documents to skip (from beginning). - By default, we sort by all documents descendingly by start time. + By default, we sort by all documents in descending order by start time. :keyword int results_per_page: is the number of documents returned per page. :keyword list[str] document_ids: document IDs to filter by. :keyword list[str] statuses: document statuses to filter by. Options include diff --git a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_client_async.py b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_client_async.py index 96a8d0f10a76..80280cf6bda7 100644 --- a/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_client_async.py +++ b/sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_client_async.py @@ -264,7 +264,7 @@ def list_translation_statuses(self, **kwargs): :keyword int top: the total number of operations to return (across all pages) from all submitted translations. :keyword int skip: the number of operations to skip (from beginning of all submitted operations). - By default, we sort by all submitted operations descendingly by start time. + By default, we sort by all submitted operations in descending order by start time. :keyword int results_per_page: is the number of operations returned per page. :keyword list[str] translation_ids: translation operations ids to filter by. :keyword list[str] statuses: translation operation statuses to filter by. Options include @@ -333,7 +333,7 @@ def list_document_statuses(self, translation_id, **kwargs): :param str translation_id: ID of translation operation to list documents for. :keyword int top: the total number of documents to return (across all pages). :keyword int skip: the number of documents to skip (from beginning). - By default, we sort by all documents descendingly by start time. + By default, we sort by all documents in descending order by start time. :keyword int results_per_page: is the number of documents returned per page. :keyword list[str] document_ids: document IDs to filter by. :keyword list[str] statuses: document statuses to filter by. Options include diff --git a/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translation_with_azure_blob_async.py b/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translation_with_azure_blob_async.py index 8e2e5525ac0a..4322100e502f 100644 --- a/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translation_with_azure_blob_async.py +++ b/sdk/translation/azure-ai-translation-document/samples/async_samples/sample_translation_with_azure_blob_async.py @@ -30,7 +30,7 @@ 6) AZURE_STORAGE_SOURCE_CONTAINER_NAME - the name of your source container 7) AZURE_STORAGE_TARGET_CONTAINER_NAME - the name of your target container 8) AZURE_DOCUMENT_NAME - the name and file extension of your document in this directory - e.g. "mydocument.txt" + e.g. "document.txt" """ import os diff --git a/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_azure_blob.py b/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_azure_blob.py index d8ca6e38cdac..737a40dcccbb 100644 --- a/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_azure_blob.py +++ b/sdk/translation/azure-ai-translation-document/samples/sample_translation_with_azure_blob.py @@ -30,7 +30,7 @@ 6) AZURE_STORAGE_SOURCE_CONTAINER_NAME - the name of your source container 7) AZURE_STORAGE_TARGET_CONTAINER_NAME - the name of your target container 8) AZURE_DOCUMENT_NAME - the name and file extension of your document in this directory - e.g. "mydocument.txt" + e.g. "document.txt" """ import os diff --git a/sdk/translation/azure-ai-translation-document/tests/asynctestcase.py b/sdk/translation/azure-ai-translation-document/tests/asynctestcase.py index a7fe4612cac8..983c9c0d432d 100644 --- a/sdk/translation/azure-ai-translation-document/tests/asynctestcase.py +++ b/sdk/translation/azure-ai-translation-document/tests/asynctestcase.py @@ -78,7 +78,7 @@ async def _begin_multiple_translations_async(self, async_client, operations_coun return result_ids async def _begin_and_validate_translation_with_multiple_docs_async(self, async_client, docs_count, **kwargs): - # get input parms + # get input params wait_for_operation = kwargs.pop('wait', False) language_code = kwargs.pop('language_code', "es") diff --git a/sdk/translation/azure-ai-translation-document/tests/test_list_document_statuses.py b/sdk/translation/azure-ai-translation-document/tests/test_list_document_statuses.py index fa33f2a98cca..193b66e00692 100644 --- a/sdk/translation/azure-ai-translation-document/tests/test_list_document_statuses.py +++ b/sdk/translation/azure-ai-translation-document/tests/test_list_document_statuses.py @@ -133,10 +133,10 @@ def test_list_document_statuses_order_by_creation_time_asc(self, client): doc_statuses = list(client.list_document_statuses(poller.id, order_by=["created_on asc"])) # convert from generic iterator to list self.assertEqual(len(doc_statuses), docs_count) - curr = datetime.min + current = datetime.min for document in doc_statuses: - assert(document.created_on.replace(tzinfo=None) >= curr.replace(tzinfo=None)) - curr = document.created_on + assert(document.created_on.replace(tzinfo=None) >= current.replace(tzinfo=None)) + current = document.created_on @DocumentTranslationPreparer() @@ -152,10 +152,10 @@ def test_list_document_statuses_order_by_creation_time_desc(self, client): doc_statuses = list(client.list_document_statuses(poller.id, order_by=["created_on desc"])) # convert from generic iterator to list self.assertEqual(len(doc_statuses), docs_count) - curr = datetime.max + current = datetime.max for document in doc_statuses: - assert(document.created_on.replace(tzinfo=None) <= curr.replace(tzinfo=None)) - curr = document.created_on + assert(document.created_on.replace(tzinfo=None) <= current.replace(tzinfo=None)) + current = document.created_on @DocumentTranslationPreparer() @DocumentTranslationClientPreparer() @@ -190,15 +190,15 @@ def test_list_document_statuses_mixed_filters(self, client): # check statuses counter = 0 - curr_time = datetime.min + current_time = datetime.min for page in filtered_docs: page_docs = list(page) self.assertLessEqual(len(page_docs), results_per_page) # assert paging for doc in page_docs: counter += 1 # assert ordering - assert(doc.created_on.replace(tzinfo=None) >= curr_time.replace(tzinfo=None)) - curr_time = doc.created_on + assert(doc.created_on.replace(tzinfo=None) >= current_time.replace(tzinfo=None)) + current_time = doc.created_on # assert filters self.assertIn(doc.status, statuses) self.assertIn(doc.id, ids) diff --git a/sdk/translation/azure-ai-translation-document/tests/test_list_document_statuses_async.py b/sdk/translation/azure-ai-translation-document/tests/test_list_document_statuses_async.py index 5d19e120601e..c0531f0b768d 100644 --- a/sdk/translation/azure-ai-translation-document/tests/test_list_document_statuses_async.py +++ b/sdk/translation/azure-ai-translation-document/tests/test_list_document_statuses_async.py @@ -155,12 +155,12 @@ async def test_list_document_statuses_order_by_creation_time_asc(self, client): # check doc statuses doc_statuses = client.list_document_statuses(poller.id, order_by=["created_on asc"]) - curr = datetime.min + current = datetime.min docs = [] async for document in doc_statuses: docs.append(document) - assert(document.created_on.replace(tzinfo=None) >= curr.replace(tzinfo=None)) - curr = document.created_on + assert(document.created_on.replace(tzinfo=None) >= current.replace(tzinfo=None)) + current = document.created_on self.assertEqual(len(docs), docs_count) @@ -177,12 +177,12 @@ async def test_list_document_statuses_order_by_creation_time_desc(self, client): # check doc statuses doc_statuses = client.list_document_statuses(poller.id, order_by=["created_on desc"]) - curr = datetime.max + current = datetime.max docs = [] async for document in doc_statuses: docs.append(document) - assert(document.created_on.replace(tzinfo=None) <= curr.replace(tzinfo=None)) - curr = document.created_on + assert(document.created_on.replace(tzinfo=None) <= current.replace(tzinfo=None)) + current = document.created_on self.assertEqual(len(docs), docs_count) @@ -218,15 +218,15 @@ async def test_list_document_statuses_mixed_filters(self, client): # check statuses counter = 0 - curr_time = datetime.min + current_time = datetime.min async for page in filtered_docs: page_docs = [] async for doc in page: counter += 1 page_docs.append(doc) # assert ordering - assert(doc.created_on.replace(tzinfo=None) >= curr_time.replace(tzinfo=None)) - curr_time = doc.created_on + assert(doc.created_on.replace(tzinfo=None) >= current_time.replace(tzinfo=None)) + current_time = doc.created_on # assert filters self.assertIn(doc.status, statuses) self.assertIn(doc.id, ids) diff --git a/sdk/translation/azure-ai-translation-document/tests/test_list_translations.py b/sdk/translation/azure-ai-translation-document/tests/test_list_translations.py index 43749d329685..b13328364df5 100644 --- a/sdk/translation/azure-ai-translation-document/tests/test_list_translations.py +++ b/sdk/translation/azure-ai-translation-document/tests/test_list_translations.py @@ -179,10 +179,10 @@ def test_list_translations_order_by_creation_time_asc(self, client): self.assertIsNotNone(submitted_translations) # check statuses - curr = datetime.min + current = datetime.min for translation in submitted_translations: - assert(translation.created_on.replace(tzinfo=None) >= curr.replace(tzinfo=None)) - curr = translation.created_on + assert(translation.created_on.replace(tzinfo=None) >= current.replace(tzinfo=None)) + current = translation.created_on @DocumentTranslationPreparer() @@ -199,10 +199,10 @@ def test_list_translations_order_by_creation_time_desc(self, client): self.assertIsNotNone(submitted_translations) # check statuses - curr = datetime.max + current = datetime.max for translation in submitted_translations: - assert(translation.created_on.replace(tzinfo=None) <= curr.replace(tzinfo=None)) - curr = translation.created_on + assert(translation.created_on.replace(tzinfo=None) <= current.replace(tzinfo=None)) + current = translation.created_on @pytest.mark.live_test_only() @DocumentTranslationPreparer() @@ -234,15 +234,15 @@ def test_list_translations_mixed_filters(self, client): ).by_page() # check statuses - curr_time = datetime.min + current_time = datetime.min for page in submitted_translations: page_translations = list(page) self.assertLessEqual(len(page_translations), results_per_page) # assert paging for translation in page_translations: self.assertIn(translation.id, successful_translation_ids) # assert ordering - assert(translation.created_on.replace(tzinfo=None) >= curr_time.replace(tzinfo=None)) - curr_time = translation.created_on + assert(translation.created_on.replace(tzinfo=None) >= current_time.replace(tzinfo=None)) + current_time = translation.created_on # assert filters assert(translation.created_on.replace(tzinfo=None) <= end.replace(tzinfo=None)) assert(translation.created_on.replace(tzinfo=None) >= start.replace(tzinfo=None)) diff --git a/sdk/translation/azure-ai-translation-document/tests/test_list_translations_async.py b/sdk/translation/azure-ai-translation-document/tests/test_list_translations_async.py index 593492eff725..87fbc6e44328 100644 --- a/sdk/translation/azure-ai-translation-document/tests/test_list_translations_async.py +++ b/sdk/translation/azure-ai-translation-document/tests/test_list_translations_async.py @@ -191,10 +191,10 @@ async def test_list_translations_order_by_creation_time_asc(self, client): self.assertIsNotNone(submitted_translations) # check statuses - curr = datetime.min + current = datetime.min async for translation in submitted_translations: - assert(translation.created_on.replace(tzinfo=None) >= curr.replace(tzinfo=None)) - curr = translation.created_on + assert(translation.created_on.replace(tzinfo=None) >= current.replace(tzinfo=None)) + current = translation.created_on @DocumentTranslationPreparer() @@ -211,10 +211,10 @@ async def test_list_translations_order_by_creation_time_desc(self, client): self.assertIsNotNone(submitted_translations) # check statuses - curr = datetime.max + current = datetime.max async for translation in submitted_translations: - assert(translation.created_on.replace(tzinfo=None) <= curr.replace(tzinfo=None)) - curr = translation.created_on + assert(translation.created_on.replace(tzinfo=None) <= current.replace(tzinfo=None)) + current = translation.created_on @pytest.mark.live_test_only() @DocumentTranslationPreparer() @@ -246,7 +246,7 @@ async def test_list_translations_mixed_filters(self, client): ).by_page() # check statuses - curr_time = datetime.min + current_time = datetime.min async for page in submitted_translations: counter = 0 async for translation in page: @@ -254,8 +254,8 @@ async def test_list_translations_mixed_filters(self, client): # assert id self.assertIn(translation.id, successful_translation_ids) # assert ordering - assert(translation.created_on.replace(tzinfo=None) >= curr_time.replace(tzinfo=None)) - curr_time = translation.created_on + assert(translation.created_on.replace(tzinfo=None) >= current_time.replace(tzinfo=None)) + current_time = translation.created_on # assert filters assert(translation.created_on.replace(tzinfo=None) <= end.replace(tzinfo=None)) assert(translation.created_on.replace(tzinfo=None) >= start.replace(tzinfo=None)) diff --git a/sdk/translation/azure-ai-translation-document/tests/test_translation.py b/sdk/translation/azure-ai-translation-document/tests/test_translation.py index 6df3cec8f04c..9ff0d0620f30 100644 --- a/sdk/translation/azure-ai-translation-document/tests/test_translation.py +++ b/sdk/translation/azure-ai-translation-document/tests/test_translation.py @@ -550,6 +550,6 @@ def test_translation_with_glossary(self, client): with open(document, "rb") as fd: translated = fd.readline() - + # cSpell:ignore essai assert b'essai' in translated # glossary worked os.remove(document) diff --git a/sdk/translation/azure-ai-translation-document/tests/test_translation_async.py b/sdk/translation/azure-ai-translation-document/tests/test_translation_async.py index 8c831b622a59..4494df5e653c 100644 --- a/sdk/translation/azure-ai-translation-document/tests/test_translation_async.py +++ b/sdk/translation/azure-ai-translation-document/tests/test_translation_async.py @@ -549,6 +549,6 @@ async def test_translation_with_glossary(self, client): with open(document, "rb") as fd: translated = fd.readline() - + # cSpell:ignore essai assert b'essai' in translated # glossary worked os.remove(document) diff --git a/sdk/translation/azure-ai-translation-document/tests/testcase.py b/sdk/translation/azure-ai-translation-document/tests/testcase.py index 4176df7f74b6..32d08668c949 100644 --- a/sdk/translation/azure-ai-translation-document/tests/testcase.py +++ b/sdk/translation/azure-ai-translation-document/tests/testcase.py @@ -282,7 +282,7 @@ def _begin_multiple_translations(self, client, operations_count, **kwargs): return result_job_ids def _begin_and_validate_translation_with_multiple_docs(self, client, docs_count, **kwargs): - # get input parms + # get input params wait_for_operation = kwargs.pop('wait', False) language_code = kwargs.pop('language_code', "es")