Fix issues #13569, #6077, and #13080 - #14541
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the Airflow DB cleanup workflow, adds commented-out configuration instructions for custom JWT audiences in the Bookstore gRPC endpoints, and updates the Text-to-Speech streaming quickstart snippet to write the audio stream into a playable WAV file. In airflow_db_cleanup.py, removing + [None] prevents rows with a NULL dag_id from being cleaned up. A suggestion was made to use a list comprehension that preserves None as None and only converts non-null values to strings.
| session.commit() | ||
|
|
||
| list_dags = [str(list(dag)[0]) for dag in dags] + [None] | ||
| list_dags = [str(list(dag)[0]) for dag in dags] |
There was a problem hiding this comment.
By removing + [None], any database rows with a NULL dag_id (which are common in tables like Log) will never be cleaned up. Furthermore, converting None to a string (str(None)) results in "None", which causes a useless query for a DAG literally named "None".
Using a list comprehension that preserves None as None and only converts non-null values to strings solves both issues: it correctly cleans up NULL dag_id rows when they exist, avoids querying for the literal string "None", and avoids running redundant None queries for tables that do not contain any NULL dag_ids.
| list_dags = [str(list(dag)[0]) for dag in dags] | |
| list_dags = [str(dag[0]) if dag[0] is not None else None for dag in dags] |
Description
This PR addresses the following issues:
max_db_entry_age_in_daysare deleted #13569 — Airflow DB cleanupgoogle.api.Serviceconfig seems to require an audience to avoid JWT validation errors #6077 — Endpoints JWT audiencesstreaming_synthesizein streaming_tts_quickstart.py #13080 — Text-to-Speech streaming WAVChanges
Testing
git diff --check.Related Issues
Fixes #13569
Fixes #6077
Fixes #13080