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


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/task_state.py:
##########
@@ -47,6 +50,36 @@ def _get_scope(dag_id: str, dag_run_id: str, task_id: str, 
map_index: int) -> Ta
     return TaskScope(dag_id=dag_id, run_id=dag_run_id, task_id=task_id, 
map_index=map_index)
 
 
+def _resolve_expires_at(expires_at: datetime | None | str) -> datetime | None:

Review Comment:
   I thought about it and moving this into a Pydantic validator would pull 
`airflow.configuration.conf` into the datamodel layer here and I do not think 
config reads belong there, they belong in the route/application layer, not at 
model layer. 
   
   It would also force every unit test that constructs a 
`TaskStateBody(expires_at="default")` to mock config. The standalone function 
in the route keeps the layers clean. 



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