From ce17c0bd1a491aaa6486739a92f7a1171db5f463 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 13 Oct 2020 22:36:33 +0200 Subject: [PATCH] chore(deps): update dependency google-cloud-vision to v2 (#71) * chore(deps): update dependency google-cloud-vision to v2 * remove types Co-authored-by: Leah Cole Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com> --- .../snippets/hybrid_glossaries/hybrid_tutorial.py | 12 ++++++------ .../snippets/hybrid_glossaries/requirements.txt | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-translate/samples/snippets/hybrid_glossaries/hybrid_tutorial.py b/packages/google-cloud-translate/samples/snippets/hybrid_glossaries/hybrid_tutorial.py index c98bdd0ee041..9eae168ada3e 100644 --- a/packages/google-cloud-translate/samples/snippets/hybrid_glossaries/hybrid_tutorial.py +++ b/packages/google-cloud-translate/samples/snippets/hybrid_glossaries/hybrid_tutorial.py @@ -51,7 +51,7 @@ def pic_to_text(infile): with io.open(infile, "rb") as image_file: content = image_file.read() - image = vision.types.Image(content=content) + image = vision.Image(content=content) # For dense text, use document_text_detection # For less dense text, use text_detection @@ -88,16 +88,16 @@ def create_glossary(languages, project_id, glossary_name, glossary_uri): name = client.glossary_path(project_id, location, glossary_name) # Set language codes - language_codes_set = translate.types.Glossary.LanguageCodesSet( + language_codes_set = translate.Glossary.LanguageCodesSet( language_codes=languages ) - gcs_source = translate.types.GcsSource(input_uri=glossary_uri) + gcs_source = translate.GcsSource(input_uri=glossary_uri) - input_config = translate.types.GlossaryInputConfig(gcs_source=gcs_source) + input_config = translate.GlossaryInputConfig(gcs_source=gcs_source) # Set glossary resource information - glossary = translate.types.Glossary( + glossary = translate.Glossary( name=name, language_codes_set=language_codes_set, input_config=input_config ) @@ -145,7 +145,7 @@ def translate_text( glossary = client.glossary_path(project_id, location, glossary_name) - glossary_config = translate.types.TranslateTextGlossaryConfig(glossary=glossary) + glossary_config = translate.TranslateTextGlossaryConfig(glossary=glossary) parent = f"projects/{project_id}/locations/{location}" diff --git a/packages/google-cloud-translate/samples/snippets/hybrid_glossaries/requirements.txt b/packages/google-cloud-translate/samples/snippets/hybrid_glossaries/requirements.txt index af2fa0673154..86b3d1b39596 100644 --- a/packages/google-cloud-translate/samples/snippets/hybrid_glossaries/requirements.txt +++ b/packages/google-cloud-translate/samples/snippets/hybrid_glossaries/requirements.txt @@ -1,3 +1,3 @@ google-cloud-translate==3.0.0 -google-cloud-vision==1.0.0 +google-cloud-vision==2.0.0 google-cloud-texttospeech==2.1.0