diff --git a/packages/google-cloud-translate/samples/snippets/hybrid_glossaries/resources/example.mp3 b/packages/google-cloud-translate/samples/snippets/hybrid_glossaries/resources/example.mp3 new file mode 100644 index 000000000000..5b5f02512dcb Binary files /dev/null and b/packages/google-cloud-translate/samples/snippets/hybrid_glossaries/resources/example.mp3 differ diff --git a/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text.py b/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text.py index b4650e054b24..6c67d2c22dc6 100644 --- a/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text.py +++ b/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text.py @@ -46,7 +46,7 @@ def batch_translate_text( output_config=output_config) print(u"Waiting for operation to complete...") - response = operation.result(90) + response = operation.result(180) print(u"Total Characters: {}".format(response.total_characters)) print(u"Translated Characters: {}".format(response.translated_characters)) diff --git a/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_test.py b/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_test.py index c6e1e6e352e7..2474f60d56a9 100644 --- a/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_test.py +++ b/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_test.py @@ -24,7 +24,7 @@ @pytest.fixture(scope="function") def bucket(): """Create a temporary bucket to store annotation output.""" - bucket_name = str(uuid.uuid1()) + bucket_name = "test-{}".format(uuid.uuid4()) storage_client = storage.Client() bucket = storage_client.create_bucket(bucket_name) diff --git a/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_with_glossary.py b/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_with_glossary.py index fa08d641b5ec..d72c31860b8c 100644 --- a/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_with_glossary.py +++ b/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_with_glossary.py @@ -65,7 +65,7 @@ def batch_translate_text_with_glossary( ) print(u"Waiting for operation to complete...") - response = operation.result(120) + response = operation.result(180) print(u"Total Characters: {}".format(response.total_characters)) print(u"Translated Characters: {}".format(response.translated_characters)) diff --git a/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_with_glossary_test.py b/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_with_glossary_test.py index 87d97b73c044..0e79bf9b8693 100644 --- a/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_with_glossary_test.py +++ b/packages/google-cloud-translate/samples/snippets/translate_v3_batch_translate_text_with_glossary_test.py @@ -27,7 +27,7 @@ @pytest.fixture(scope="session") def glossary(): """Get the ID of a glossary available to session (do not mutate/delete).""" - glossary_id = "must-start-with-letters-" + str(uuid.uuid1()) + glossary_id = "test-{}".format(uuid.uuid4()) translate_v3_create_glossary.create_glossary( PROJECT_ID, GLOSSARY_INPUT_URI, glossary_id ) diff --git a/packages/google-cloud-translate/samples/snippets/translate_v3_create_glossary.py b/packages/google-cloud-translate/samples/snippets/translate_v3_create_glossary.py index b42d33c8e969..a94e488eb4a5 100644 --- a/packages/google-cloud-translate/samples/snippets/translate_v3_create_glossary.py +++ b/packages/google-cloud-translate/samples/snippets/translate_v3_create_glossary.py @@ -51,7 +51,7 @@ def create_glossary( # to translate the domain-specific terminology. operation = client.create_glossary(parent=parent, glossary=glossary) - result = operation.result(timeout=90) + result = operation.result(timeout=180) print("Created: {}".format(result.name)) print("Input Uri: {}".format(result.input_config.gcs_source.input_uri)) diff --git a/packages/google-cloud-translate/samples/snippets/translate_v3_create_glossary_test.py b/packages/google-cloud-translate/samples/snippets/translate_v3_create_glossary_test.py index bf9f08cb951d..77a2cf1435cc 100644 --- a/packages/google-cloud-translate/samples/snippets/translate_v3_create_glossary_test.py +++ b/packages/google-cloud-translate/samples/snippets/translate_v3_create_glossary_test.py @@ -22,7 +22,7 @@ def test_create_glossary(capsys): - glossary_id = "must-start-with-letters-" + str(uuid.uuid1()) + glossary_id = "test-{}".format(uuid.uuid4()) translate_v3_create_glossary.create_glossary( PROJECT_ID, GLOSSARY_INPUT_URI, glossary_id ) diff --git a/packages/google-cloud-translate/samples/snippets/translate_v3_delete_glossary.py b/packages/google-cloud-translate/samples/snippets/translate_v3_delete_glossary.py index da1acb40c7b6..f3f897532149 100644 --- a/packages/google-cloud-translate/samples/snippets/translate_v3_delete_glossary.py +++ b/packages/google-cloud-translate/samples/snippets/translate_v3_delete_glossary.py @@ -25,7 +25,7 @@ def delete_glossary( parent = client.glossary_path(project_id, "us-central1", glossary_id) operation = client.delete_glossary(parent) - result = operation.result(timeout=90) + result = operation.result(timeout=180) print("Deleted: {}".format(result.name)) diff --git a/packages/google-cloud-translate/samples/snippets/translate_v3_delete_glossary_test.py b/packages/google-cloud-translate/samples/snippets/translate_v3_delete_glossary_test.py index 1c1fb2da52bf..8d7fb2d92451 100644 --- a/packages/google-cloud-translate/samples/snippets/translate_v3_delete_glossary_test.py +++ b/packages/google-cloud-translate/samples/snippets/translate_v3_delete_glossary_test.py @@ -23,7 +23,7 @@ def test_delete_glossary(capsys): # setup - glossary_id = "must-start-with-letters-" + str(uuid.uuid1()) + glossary_id = "test-{}".format(uuid.uuid4()) translate_v3_create_glossary.create_glossary( PROJECT_ID, GLOSSARY_INPUT_URI, glossary_id )