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 2020/01/17 11:22:45 UTC

[GitHub] [airflow] feluelle commented on a change in pull request #7186: [AIRFLOW-6473] Show conf in response of dag_state cli command

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

 ##########
 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:
   ```suggestion
       out = dr[0].state if dr else None
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services