samuel-geraldo commented on code in PR #76872:
URL: https://github.com/apache/airflow/pull/76872#discussion_r4581705920
##########
airflow-core/docs/core-concepts/operators.rst:
##########
@@ -366,7 +366,7 @@ For example, you can use the ``pre_execute`` method to
elegantly determine if a
Check if a given task instance should be skipped if the
`tasks_to_skip` Airflow Variable is a list that contains the task id.
"""
tasks_to_skip = Variable.get("tasks_to_skip", deserialize_json=True)
Review Comment:
`Variable.get` raises if the variable doesn't exist and no `default` is
given (see `task-sdk/src/airflow/sdk/definitions/variable.py`). As written,
`_check_skipped` would fail on every task while `tasks_to_skip` is unset, which
contradicts the docstring below ("if the `tasks_to_skip` Airflow Variable is
set"). Passing a default keeps the example consistent with its own description:
```suggestion
tasks_to_skip = Variable.get("tasks_to_skip", default=[],
deserialize_json=True)
```
--
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]