Skip to content

Commit e758548

Browse files
committed
Fix issues 13569, 6077, and 13080
1 parent 25bbbcb commit e758548

4 files changed

Lines changed: 26 additions & 3 deletions

File tree

composer/workflows/airflow_db_cleanup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ def cleanup_function(**context):
460460
dags = session.query(airflow_db_model.dag_id).distinct()
461461
session.commit()
462462

463-
list_dags = [str(list(dag)[0]) for dag in dags] + [None]
463+
list_dags = [str(list(dag)[0]) for dag in dags]
464464
for dag_id in list_dags:
465465
query = build_query(
466466
session=session,

endpoints/bookstore-grpc-transcoding/api_config_auth.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ authentication:
5252
# Replace SERVICE-ACCOUNT-ID with your service account's email address.
5353
issuer: SERVICE-ACCOUNT-ID
5454
jwks_uri: https://www.googleapis.com/robot/v1/metadata/x509/SERVICE-ACCOUNT-ID
55+
# Optional: if the JWTs you send (e.g. via jwt_token_gen.py's
56+
# --audiences flag) use a custom "aud" claim instead of your Endpoints
57+
# service name, uncomment this and set it to that same value, or ESP
58+
# will reject the token with a JWT validation error. See
59+
# https://cloud.google.com/endpoints/docs/grpc/troubleshoot-jwt
60+
# audiences: YOUR-AUDIENCE-VALUE
5561
rules:
5662
# This auth rule will apply to all methods.
5763
- selector: "*"

endpoints/bookstore-grpc/api_config_auth.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ authentication:
5252
# Replace SERVICE-ACCOUNT-ID with your service account's email address.
5353
issuer: SERVICE-ACCOUNT-ID
5454
jwks_uri: https://www.googleapis.com/robot/v1/metadata/x509/SERVICE-ACCOUNT-ID
55+
# Optional: if the JWTs you send (e.g. via jwt_token_gen.py's
56+
# --audiences flag) use a custom "aud" claim instead of your Endpoints
57+
# service name, uncomment this and set it to that same value, or ESP
58+
# will reject the token with a JWT validation error. See
59+
# https://cloud.google.com/endpoints/docs/grpc/troubleshoot-jwt
60+
# audiences: YOUR-AUDIENCE-VALUE
5561
rules:
5662
# This auth rule will apply to all methods.
5763
- selector: "*"

texttospeech/snippets/streaming_tts_quickstart.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,19 @@ def request_generator():
5858

5959
streaming_responses = client.streaming_synthesize(request_generator())
6060

61-
for response in streaming_responses:
62-
print(f"Audio content size in bytes is: {len(response.audio_content)}")
61+
# The response stream contains headerless linear PCM (LINEAR16) audio
62+
# sampled at 24000 Hz. Write it to a standard playable .wav file by
63+
# adding a proper WAV header with the stdlib `wave` module, rather than
64+
# a hand-rolled byte header.
65+
import wave
66+
67+
with wave.open("streaming_tts_quickstart_output.wav", "wb") as wav_file:
68+
wav_file.setnchannels(1) # LINEAR16 audio from this API is mono.
69+
wav_file.setsampwidth(2) # 16-bit samples (LINEAR16) = 2 bytes/sample.
70+
wav_file.setframerate(24000) # Sample rate used above.
71+
for response in streaming_responses:
72+
print(f"Audio content size in bytes is: {len(response.audio_content)}")
73+
wav_file.writeframes(response.audio_content)
6374
# [END tts_synthezise_streaming]
6475

6576

0 commit comments

Comments
 (0)