mik-laj commented on a change in pull request #9153:
URL: https://github.com/apache/airflow/pull/9153#discussion_r438012011
##########
File path: airflow/api_connexion/endpoints/dag_run_endpoint.py
##########
@@ -26,18 +34,100 @@ def delete_dag_run():
raise NotImplementedError("Not implemented yet.")
-def get_dag_run():
+@provide_session
+def get_dag_run(dag_id, dag_run_id, session):
"""
Get a DAG Run.
"""
- raise NotImplementedError("Not implemented yet.")
+ query = session.query(DagRun)
+ query = query.filter(DagRun.dag_id == dag_id)
+ query = query.filter(DagRun.run_id == dag_run_id)
+ dag_run = query.one_or_none()
+ if dag_run is None:
+ raise NotFound("DAGRun not found")
+ return dagrun_schema.dump(dag_run)
-def get_dag_runs():
+@provide_session
+def get_dag_runs(dag_id, session):
"""
Get all DAG Runs.
"""
- raise NotImplementedError("Not implemented yet.")
+ offset = request.args.get(parameters.page_offset, 0)
+ limit = min(int(request.args.get(parameters.page_limit, 100)), 100)
+
+ start_date_gte = parse_datetime_in_query(
Review comment:
I'm glad you did research. We can change it in a separate change. Now it
works, so it's great. In next changes, we will be able to make a refactor and
remove repetitive code fragments.
----------------------------------------------------------------
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]