ahilashsasidharan commented on issue #70503:
URL: https://github.com/apache/airflow/issues/70503#issuecomment-5099290577
Hey @shahar1, wanted to check if my PR #70450 falls into the PRs needed to
be restored, because it seems to fall into the class of " the usual "exactly
one of a or b" guard — belongs in __init__ and must not be moved".
I already have a change to revert my PR and to restore it back to __init__,
but it fails the prek hook:
```
No templated field logic checks in operator
__init__...........................................................Failed
- hook id: validate-operators-init
- exit code: 1
amazon/src/airflow/providers/amazon/aws/operators/dms.py
DmsModifyTaskOperator's constructor applies logic to template fields.
Template fields are rendered after the constructor runs, so validation or
transformation here acts on the un-rendered Jinja
expression and should move to execute():
line 197: if cdc_start_time is not None and cdc_start_position is not
None: (cdc_start_position, cdc_start_time)
DmsStartReplicationOperator's constructor applies logic to template
fields. Template fields are rendered after the constructor runs, so validation
or transformation here acts on the un-rendered Jinja
expression and should move to execute():
line 791: if cdc_start_time is not None and cdc_start_pos is not None:
(cdc_start_pos, cdc_start_time)
```
I am not sure if there is a separate PR to planned to narrow the hook so it
doesn't flag this, and this was a case that was missed from your list. I could
also be misunderstanding, so please correct me if I am wrong.
If it needs to be restored I can push my change I have locally once the a PR
to fix the rule is merged.
--
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]