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

   Fixes the Google provider's `CloudComposerExternalTaskSensor` entry from the 
#70296 exemption-list burn-down.
   
   Several of the sensor's template fields (`composer_external_task_id`, 
`composer_external_task_ids`, `composer_external_task_group_id`) were 
normalized and validated inside `__init__`. Because template fields are only 
rendered *after* the constructor runs, that logic operated on the raw, 
un-rendered Jinja expressions, and the `validate-operators-init` prek hook 
flagged the class.
   
   Changes:
   
   - Assign every template field directly in `__init__` (`self.field = field`) 
with no transformation, so the constructor no longer applies logic to 
un-rendered values.
   - Moved the following into `execute()`, where they act on the rendered 
values:
     - the empty-list → `None` normalization,
     - the single `composer_external_task_id` → one-element 
`composer_external_task_ids` conversion,
     - the `allowed_states` / `skipped_states` / `failed_states` validity check 
against dag- vs task-states,
     - the mutual-exclusivity checks between `composer_external_task_id`, 
`composer_external_task_ids`, and `composer_external_task_group_id`.
   - Removed the operator's entry from 
`scripts/ci/prek/validate_operators_init_exemptions.txt`.
   - Added unit tests covering post-render normalization and rendered-target 
state validation.
   
   The public constructor signature is unchanged, so this is not a breaking 
change for existing DAGs. The `DuplicateStateError` check on the non-templated 
`allowed_states`/`skipped_states`/`failed_states` remains in `__init__`.
   
   Verified locally that `scripts/ci/prek/validate_operators_init.py` reports 
zero findings for `CloudComposerExternalTaskSensor` after the change.
   
   related: #70296
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes [Claude]
   
   <!--
   Generated-by: Claude 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