shahar1 opened a new pull request, #70372: URL: https://github.com/apache/airflow/pull/70372
Follow-up to #70329, which correctly moved the `target_state` check out of `__init__` (it is a template field, so the constructor only ever sees the un-rendered Jinja expression) but landed it in `poke()`. `poke()` runs inside the error handling of `BaseSensorOperator.execute()`: - `silent_fail=True` — the `ValueError` is logged and turned into `poke_return = False`, so a misconfigured sensor keeps polling until its `timeout` (7 days by default) instead of failing. - `never_fail=True` / `soft_fail=True` — it is converted to `AirflowSkipException`, so the sensor reports **no failure at all** and downstream tasks proceed. A typo such as `target_state="Running"` (`VALID_STATES` are lowercase) silently skips. It also re-ran on every poke. Checking once in `execute()`, before the poll loop and before deferring, keeps the run-time check the template field requires while restoring an immediate, unambiguous failure. The added test uses `silent_fail=True` so it fails if the check ever moves back into `poke()`. related: #70296 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 4.8) Generated-by: Claude Code (Opus 4.8) 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]
