tooptoop4 commented on a change in pull request #7186: [AIRFLOW-6473] Show conf 
in response of dag_state cli command
URL: https://github.com/apache/airflow/pull/7186#discussion_r368140839
 
 

 ##########
 File path: airflow/cli/commands/dag_command.py
 ##########
 @@ -200,16 +200,22 @@ def dag_show(args):
 @cli_utils.action_logging
 def dag_state(args):
     """
-    Returns the state of a DagRun at the command line.
+    Returns the state (and conf if exists) of a DagRun at the command line.
     >>> airflow dags state tutorial 2015-01-01T00:00:00.000000
     running
+    >>> airflow dags state a_dag_with_conf_passed 2015-01-01T00:00:00.000000
+    failed, {"name": "bob", "age": "42"}
     """
     if args.subdir:
         dag = get_dag(args.subdir, args.dag_id)
     else:
         dag = get_dag_by_file_location(args.dag_id)
     dr = DagRun.find(dag.dag_id, execution_date=args.execution_date)
-    print(dr[0].state if len(dr) > 0 else None)  # pylint: 
disable=len-as-condition
+    out = dr[0].state if len(dr) > 0 else None  # pylint: 
disable=len-as-condition
 
 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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to