ashb commented on a change in pull request #10839:
URL: https://github.com/apache/airflow/pull/10839#discussion_r507655375



##########
File path: airflow/www/views.py
##########
@@ -1241,13 +1241,22 @@ def trigger(self, session=None):
         """Triggers DAG Run."""
         dag_id = request.values.get('dag_id')
         origin = get_safe_url(request.values.get('origin'))
+        request_conf = request.values.get('conf')
 
         if request.method == 'GET':
+            # Populate conf textarea with conf requests parameter, or 
dag.params
+            default_conf = ''
+            if request_conf:
+                default_conf = request_conf
+            else:
+                dag = current_app.dag_bag.get_dag(dag_id)
+                if dag.params:
+                    default_conf = json.dumps(dag.params, indent=4)

Review comment:
       This should have a try-catch around it -- it's entirely possible that 
something might be in the params that is not JSON-serializable (such as a 
datetime object).




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


Reply via email to