shivaam opened a new pull request, #70835: URL: https://github.com/apache/airflow/pull/70835
`CloudBatchSubmitJobOperator` converted protobuf `Job` values to dictionaries in `__init__`, before Airflow's template lifecycle runs. This made the constructor read and transform a template field and kept the operator on the validation exemption list. Move the conversion to `prepare_template()`, which runs from `resolve_template_files()` before Dag serialization and Jinja rendering. The constructor now preserves the supplied dict or protobuf object, while nested templates inside protobuf jobs are still converted, serialized, and rendered. Tests cover constructor identity, idempotent preparation, direct protobuf execution, nested Jinja rendering for dict and protobuf inputs, and the prepare-before-serialization lifecycle. Testing: ```console uv run --project providers/google pytest providers/google/tests/unit/google/cloud/operators/test_cloud_batch.py -xq # 15 passed prek run ruff-format --files providers/google/src/airflow/providers/google/cloud/operators/cloud_batch.py providers/google/tests/unit/google/cloud/operators/test_cloud_batch.py prek run ruff --files providers/google/src/airflow/providers/google/cloud/operators/cloud_batch.py providers/google/tests/unit/google/cloud/operators/test_cloud_batch.py prek run validate-operators-init --files providers/google/src/airflow/providers/google/cloud/operators/cloud_batch.py ``` Related: #70296 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — OpenAI Codex Generated-by: OpenAI Codex 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]
