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


##########
airflow-core/tests/unit/api_fastapi/execution_api/versions/head/test_task_state.py:
##########
@@ -95,6 +97,28 @@ def test_put_creates_row(self, client: TestClient, 
create_task_instance: CreateT
             assert row is not None
             assert row.value == "spark_001"
 
+    def test_put__with_retention_days_creates_row(
+        self, client: TestClient, create_task_instance: CreateTaskInstance, 
time_machine
+    ):
+
+        ti = create_task_instance()
+        time_machine.move_to(datetime(2026, 5, 5, 12, 0, 0), tick=False)
+        response = client.put(_api_url(ti.id, "job_id"), json={"value": 
"spark_001", "retention_days": 10})
+
+        assert response.status_code == 204
+        with create_session() as session:
+            row = session.scalar(
+                select(TaskStateModel).where(
+                    TaskStateModel.dag_id == ti.dag_id,
+                    TaskStateModel.run_id == ti.run_id,
+                    TaskStateModel.task_id == ti.task_id,
+                    TaskStateModel.key == "job_id",
+                )

Review Comment:
   No we do not have it cos is is already guaranteed only a TI can write its 
own state, so the column would just restate what the scope already implies. 



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