msumit commented on a change in pull request #17100:
URL: https://github.com/apache/airflow/pull/17100#discussion_r682326608
##########
File path: airflow/api_connexion/endpoints/dag_run_endpoint.py
##########
@@ -251,10 +252,12 @@ def post_dag_run(dag_id, session):
.first()
)
if not dagrun_instance:
- dag_run = DagRun(dag_id=dag_id, run_type=DagRunType.MANUAL,
**post_body)
- session.add(dag_run)
- session.commit()
- return dagrun_schema.dump(dag_run)
+ try:
+ dag = current_app.dag_bag.get_dag(dag_id)
+ dag_run = dag.create_dagrun(run_type=DagRunType.MANUAL,
state=State.RUNNING, **post_body)
Review comment:
Cause `state` was a required parameter in that function. Will use
`QUEUED`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]