sohailiqrar commented on PR #72290: URL: https://github.com/apache/airflow/pull/72290#issuecomment-5467024299
`BranchDayOfWeekOperator` and `BranchDateTimeOperator` crash with an unhandled `AttributeError: 'NoneType' object has no attribute 'run_after'` when `use_task_logical_date=True` and the execution context contains neither a `logical_date` nor a `dag_run` (e.g. standalone task execution, unit tests, custom contexts). `DayOfWeekSensor` already handles this correctly by guarding the access and raising a clear `ValueError`. This PR applies the same defensive check to both operators so callers get an actionable error message instead of a confusing NoneType traceback. closes: #72031 --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (claude-sonnet-5) Generated-by: Claude Code (claude-sonnet-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]
