henry3260 commented on code in PR #65839:
URL: https://github.com/apache/airflow/pull/65839#discussion_r3143130746
##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/dag_parsing.py:
##########
@@ -73,3 +75,31 @@ def reparse_dag_file(
parsing_request = DagPriorityParsingRequest(bundle_name=bundle_name,
relative_fileloc=relative_fileloc)
session.add(parsing_request)
+
+
+@dag_reparse_router.put(
+ "/reparse",
+ responses=create_openapi_http_exception_doc(
+ [status.HTTP_404_NOT_FOUND, status.HTTP_409_CONFLICT,
HTTP_422_UNPROCESSABLE_CONTENT]
+ ),
+ status_code=status.HTTP_201_CREATED,
+ dependencies=[Depends(requires_access_dag(method="PUT")),
Depends(action_logging())],
+)
+def reparse_dag(
+ dag_id: str,
+ session: SessionDep,
+) -> None:
+ """Request re-parsing of the file that contains the given DAG."""
+ dag = session.get(DagModel, dag_id)
+ if dag is None:
+ raise HTTPException(status.HTTP_404_NOT_FOUND, f"DAG with id
'{dag_id}' not found")
Review Comment:
```suggestion
raise HTTPException(status.HTTP_404_NOT_FOUND, f"Dag with id
'{dag_id}' not found")
```
--
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]