You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/09/14 20:36:58 UTC

[GitHub] [airflow] dstandish commented on a diff in pull request #26400: Create a more efficient airflow dag test command that also has better local logging

dstandish commented on code in PR #26400:
URL: https://github.com/apache/airflow/pull/26400#discussion_r971272230


##########
airflow/cli/commands/dag_command.py:
##########
@@ -497,6 +524,56 @@ def dag_test(args, session=None):
             print(dot_graph.source)
 
 
+def _run_task(ti: TaskInstance, session):
+    """
+    Run a single task instance, and push result to Xcom for downstream tasks. Bypasses a lot of
+    extra steps used in `task.run` to keep our local running as fast as possible
+    Args:
+        ti: TaskInstance to run
+    """
+    log.info("*****************************************************")
+    log.info("Running task %s", ti.task_id)
+    try:
+        ti._run_raw_task(session=session)
+        log.info("%s ran successfully!", ti.task_id)

Review Comment:
   could just add ti.map_index



-- 
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