Skip to content

Validate Google operator templated parameters after rendering - #70534

Open
mitre88 wants to merge 1 commit into
apache:mainfrom
mitre88:narrow-google-validation-exceptions
Open

Validate Google operator templated parameters after rendering#70534
mitre88 wants to merge 1 commit into
apache:mainfrom
mitre88:narrow-google-validation-exceptions

Conversation

@mitre88

@mitre88 mitre88 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Three Google provider operators — CloudSpeechToTextRecognizeSpeechOperator, CloudTextToSpeechSynthesizeOperator, and CloudFirestoreExportDatabaseOperator — validate their template fields (audio, config, input_data, voice, audio_config, target_bucket_name, target_filename, body) inside a _validate_inputs() helper called from __init__.

Because the helper reads the fields through a method call, the validate-operators-init check cannot see these reads (same blind spot as the AppFlow subclasses fixed in #70440), but the bug is the same one tracked in #70296: the emptiness checks run against un-rendered Jinja expressions, which are always non-empty, so a templated value rendering to an empty string is never caught. The _validate_inputs() call is moved to the start of execute() in all three operators.

While relocating them, the raise AirflowException usages are narrowed to ValueError per the ongoing exception clean-up (known_airflow_exceptions.txt entries for the three files drop to 0), following the pattern of #66279.

Tests: converted the text-to-speech missing-argument test to the new exception type (it already exercised execute), and added execute-time tests for the speech-to-text and Firestore operators that construct with a templated value and validate the rendered value — both fail against the previous implementation.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Fable 5)

Generated-by: Claude Code (Fable 5) following the guidelines

CloudSpeechToTextRecognizeSpeechOperator, CloudTextToSpeechSynthesizeOperator,
and CloudFirestoreExportDatabaseOperator validate template fields inside
_validate_inputs() called from __init__, so the checks ran against
un-rendered Jinja expressions and an empty rendered value was never
caught. The validation now runs at execute time, and the raises are
narrowed from AirflowException to ValueError per the ongoing exception
clean-up.
@mitre88
mitre88 requested a review from shahar1 as a code owner July 27, 2026 15:40
@boring-cyborg boring-cyborg Bot added area:providers provider:google Google (including GCP) related issues labels Jul 27, 2026
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:google Google (including GCP) related issues ready for maintainer review Set after triaging when all criteria pass.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants