amoghrajesh commented on code in PR #67890:
URL: https://github.com/apache/airflow/pull/67890#discussion_r3345768854


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_store.py:
##########
@@ -61,7 +61,13 @@ def _resolve_expires_at(expires_at: datetime | None | 
Literal["default"]) -> dat
     """
     if expires_at == "default":
         days = conf.getint("state_store", "default_retention_days")
-        return datetime.now(tz=timezone.utc) + timedelta(days=days)
+        if days < 0:
+            raise HTTPException(
+                status_code=status.HTTP_400_BAD_REQUEST,
+                detail=f"[state_store] default_retention_days must be >= 0, 
got {days}. "
+                "Set to 0 to disable expiry.",
+            )
+        return None if days == 0 else datetime.now(tz=timezone.utc) + 
timedelta(days=days)

Review Comment:
   Added in docstring as well along with PR desc: db23dd0946



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

Reply via email to