vatsrahul1001 commented on code in PR #45731:
URL: https://github.com/apache/airflow/pull/45731#discussion_r1922641257
##########
airflow/api_fastapi/core_api/routes/public/backfills.py:
##########
@@ -216,6 +218,17 @@ def create_backfill(
status_code=status.HTTP_409_CONFLICT,
detail=f"{backfill_request.dag_id} has no schedule",
)
+ except InvalidReprocessBehavior:
+ raise HTTPException(
+ status_code=status.HTTP_409_CONFLICT,
+ detail=f"{backfill_request.dag_id} has tasks for which
depends_on_past=True. "
+ "You must set reprocess behavior to reprocess completed or
reprocess failed.",
+ )
+ except InvalidBackfillDirection:
+ raise HTTPException(
+ status_code=status.HTTP_409_CONFLICT,
+ detail="Backfill cannot be run in reverse when the DAG has tasks
where depends_on_past=True.",
+ )
Review Comment:
No. I tried adding this to class
```
class InvalidReprocessBehavior(AirflowException):
"""
Raised when a backfill cannot be completed because the reprocess
behavior is not valid.
:meta private:
"""
def __init__(self, dag_id: str):
self.dag_id = dag_id
self.message = (
f"{dag_id} has tasks for which depends_on_past=True. "
"You must set reprocess behavior to reprocess completed or
reprocess failed."
)
super().__init__(self.message)
```
However, I am only getting below error message
```
{
"detail": "Unprocessable Entity"
}
```
--
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]