From 67fc09a3643f402e6880b5f0b0dbe1901ab3b5dd Mon Sep 17 00:00:00 2001 From: Yvonne Li Date: Mon, 23 May 2022 15:45:46 -0700 Subject: [PATCH] fix: library deprecation warnings (#376) * fix: warning message * docs: correct naming Co-authored-by: Yvonne --- speech/snippets/speech_to_storage_beta.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/speech/snippets/speech_to_storage_beta.py b/speech/snippets/speech_to_storage_beta.py index a807a72af4e2..549388285f6e 100644 --- a/speech/snippets/speech_to_storage_beta.py +++ b/speech/snippets/speech_to_storage_beta.py @@ -66,12 +66,12 @@ def export_transcript_to_storage_beta( # get blob from bucket blob = bucket.get_blob(object_name) - # get content as string - results_string = blob.download_as_string() + # get content as bytes + results_bytes = blob.download_as_bytes() # get transcript exported in storage bucket storage_transcript = types.LongRunningRecognizeResponse.from_json( - results_string, ignore_unknown_fields=True + results_bytes, ignore_unknown_fields=True ) # Each result is for a consecutive portion of the audio. Iterate through