You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2023/09/22 04:41:11 UTC
[GitHub] [airflow] potiuk commented on a diff in pull request #28900: Convert DagFileProcessor.execute_callbacks to Internal API
potiuk commented on code in PR #28900:
URL: https://github.com/apache/airflow/pull/28900#discussion_r1333867561
##########
airflow/models/taskinstance.py:
##########
@@ -190,23 +192,24 @@ def set_current_context(context: Context) -> Generator[Context, None, None]:
)
-def _stop_remaining_tasks(*, self, session: Session):
+def _stop_remaining_tasks(*, task_instance: TaskInstance | TaskInstancePydantic, session: Session):
"""
Stop non-teardown tasks in dag.
:meta private:
"""
- tis = self.dag_run.get_task_instances(session=session)
+ assert task_instance.dag_run is not None
Review Comment:
We only use asserts in in special circumstances - I suggest to change it to
```
if not task_instance_.dag_run:
raise ValueError("task_instance must have dag_run set")
```
or similar.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org