ashb commented on code in PR #46302:
URL: https://github.com/apache/airflow/pull/46302#discussion_r1936881740
##########
task_sdk/src/airflow/sdk/execution_time/task_runner.py:
##########
@@ -519,32 +519,31 @@ def run(ti: RuntimeTaskInstance, log: Logger):
inlets = [asset.asprofile() for asset in ti.task.inlets if
isinstance(asset, Asset)]
outlets = [asset.asprofile() for asset in ti.task.outlets if
isinstance(asset, Asset)]
SUPERVISOR_COMMS.send_request(msg=RuntimeCheckOnTask(inlets=inlets,
outlets=outlets), log=log) # type: ignore
- msg = SUPERVISOR_COMMS.get_message() # type: ignore
-
- if isinstance(msg, OKResponse) and not msg.ok:
- log.info("Runtime checks failed for task, marking task as
failed..")
- msg = TaskState(
- state=TerminalTIState.FAILED,
- end_date=datetime.now(tz=timezone.utc),
- )
- else:
- context = ti.get_template_context()
- with set_current_context(context):
- jinja_env = ti.task.dag.get_template_env()
- ti.task = ti.render_templates(context=context,
jinja_env=jinja_env)
- # TODO: Get things from _execute_task_with_callbacks
- # - Pre Execute
- # etc
- result = _execute_task(context, ti.task)
-
- _push_xcom_if_needed(result, ti)
-
- task_outlets, outlet_events = _process_outlets(context,
ti.task.outlets)
- msg = SucceedTask(
- end_date=datetime.now(tz=timezone.utc),
- task_outlets=task_outlets,
- outlet_events=outlet_events,
- )
+ ok_response = SUPERVISOR_COMMS.get_message() # type: ignore
+ if isinstance(ok_response, OKResponse) and not ok_response.ok:
Review Comment:
```suggestion
if not isinstance(ok_response, OKResponse) or not ok_response.ok:
```
Just in case we get some other object type back?
--
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]