mitre88 opened a new pull request, #70531: URL: https://github.com/apache/airflow/pull/70531
Part of the template-field validation burn-down tracked in #70296. `CloudFunctionDeployFunctionOperator` lists `body`, `location`, and `api_version` in `template_fields`, but `__init__` validated the body, ran `ZipPathPreprocessor.preprocess_body()` (which both validates and mutates the body), and constructed `GcpBodyFieldValidator` pinned to the un-rendered `api_version`. A fully templated `body` crashed with `AttributeError` at parse time inside the preprocessor. All of this now runs at the start of `execute()` against the rendered values. The missing-`location`/`body` truthiness checks and the zip-path exclusivity rules depend on rendered values (an expression rendering to an empty string must count as missing), so per the discussion in #70505 these are genuine value reads, not provision checks. Tests: converted the four construction-time raise tests to execute-time, and added `test_templated_body_deploys_after_rendering`, which constructs the operator with a templated `body` (previously a parse-time crash) and deploys once the field holds the rendered value — it fails against the previous implementation. The class is removed from the exemption list and the `validate-operators-init` check passes locally. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Fable 5) Generated-by: Claude Code (Fable 5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
