jerryzhou196 opened a new pull request, #71318:
URL: https://github.com/apache/airflow/pull/71318

   `DataprocSubmitJobOperator.__init__` built `start_trigger_args` from `job`, 
`project_id`,
   `region`, `gcp_conn_id`, `impersonation_chain` and `request_id` — all of 
them template
   fields, so in the constructor they still hold the un-rendered Jinja 
expression. Those raw
   strings were then what the operator advertised (and what got serialized) as 
the arguments
   for starting directly in the triggerer.
   
   Reproducer on `main`:
   
   ```python
   op = DataprocSubmitJobOperator(
       task_id="submit",
       region="{{ params.region }}",
       project_id="{{ params.project }}",
       job={"reference": {"job_id": "job-{{ ds }}"}},
       deferrable=True,
       start_from_trigger=True,
   )
   op.start_trigger_args.trigger_kwargs
   # {'job': {'reference': {'job_id': 'job-{{ ds }}'}}, 'project_id': '{{ 
params.project }}',
   #  'region': '{{ params.region }}', ...}
   ```
   
   Rendering the fields afterwards does not help — `trigger_kwargs` keeps the 
parse-time copy.
   
   `start_trigger_args` is now built in `render_template_fields()`, the first 
method that runs
   after rendering, so it holds the rendered values. It is created with 
`dataclasses.replace`
   so the class-level template is left untouched for the next task built from 
the operator.
   
   Regression tests are added for the rendered values and for the per-task 
isolation; the first
   fails on `main`.
   
   Removes the class from 
`scripts/ci/prek/validate_operators_init_exemptions.txt`.
   
   related: #70296
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5)
   
   Generated-by: Claude Code (Opus 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]

Reply via email to