You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "mobuchowski (via GitHub)" <gi...@apache.org> on 2023/07/21 12:53:49 UTC
[GitHub] [airflow] mobuchowski commented on a diff in pull request #32716: task instance listener: call on_task_instance_running after rendering templates
mobuchowski commented on code in PR #32716:
URL: https://github.com/apache/airflow/pull/32716#discussion_r1270643794
##########
airflow/models/taskinstance.py:
##########
@@ -1601,7 +1596,8 @@ def _register_dataset_changes(self, *, session: Session) -> None:
session=session,
)
- def _execute_task_with_callbacks(self, context, test_mode=False):
+ @provide_session
+ def _execute_task_with_callbacks(self, context, test_mode: bool = False, session: Session = NEW_SESSION):
Review Comment:
Fixed.
##########
airflow/models/taskinstance.py:
##########
@@ -1498,14 +1498,9 @@ def _run_raw_task(
self.task = self.task.prepare_for_execution()
context = self.get_template_context(ignore_param_exceptions=False)
- # We lose previous state because it's changed in other process in LocalTaskJob.
- # We could probably pass it through here though...
- get_listener_manager().hook.on_task_instance_running(
- previous_state=TaskInstanceState.QUEUED, task_instance=self, session=session
- )
try:
if not mark_success:
- self._execute_task_with_callbacks(context, test_mode)
+ self._execute_task_with_callbacks(context, test_mode, session)
Review Comment:
Fixed.
--
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