ashb commented on a change in pull request #4275: AIRFLOW-3437 Adding better 
json
URL: https://github.com/apache/airflow/pull/4275#discussion_r268581416
 
 

 ##########
 File path: airflow/www/api/experimental/endpoints.py
 ##########
 @@ -84,8 +90,11 @@ def trigger_dag(dag_id):
 
     if getattr(g, 'user', None):
         _log.info("User {} created {}".format(g.user, dr))
-
-    response = jsonify(message="Created {}".format(dr))
+    if detailed_output:
+        dr = format_dag_run(dr)
+        response = jsonify(**dr)
+    else:
+        response = jsonify(message="Created {}".format(dr))
 
 Review comment:
   Why  not have both?
   
   ```
   return  jsonify(message="Created {}".format(dr), **dr)
   ```
   
   That makes it easier to deprecate  the old message over time without also 
having to add special handling of the new parameter.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to