hkc-8010 commented on code in PR #69403:
URL: https://github.com/apache/airflow/pull/69403#discussion_r3700017238
##########
airflow-core/src/airflow/api_fastapi/execution_api/routes/task_instances.py:
##########
@@ -879,6 +881,42 @@ def _raise_ti_not_in_live_table(task_instance_id: UUID,
session: SessionDep) ->
)
+@ti_id_router.patch(
+ "/{task_instance_id}/dag-run-note",
+ status_code=status.HTTP_204_NO_CONTENT,
+ responses=create_openapi_http_exception_doc(
+ [
+ (status.HTTP_404_NOT_FOUND, "Task Instance not found"),
+ (HTTP_422_UNPROCESSABLE_CONTENT, "Invalid payload for the DagRun
note update"),
+ ]
+ ),
+)
+def update_dag_run_note(
+ task_instance_id: UUID,
+ body: DagRunNoteUpdatePayload,
+ session: SessionDep,
+) -> None:
+ """Update the note for the DagRun associated with this task instance."""
+ bind_contextvars(ti_id=str(task_instance_id))
+
+ dag_run = session.scalar(
+ select(DR)
+ .join(TI, and_(TI.dag_id == DR.dag_id, TI.run_id == DR.run_id))
+ .options(joinedload(DR.dag_run_note))
+ .where(TI.id == task_instance_id)
+ )
+ if dag_run is None:
+ raise HTTPException(
+ status_code=status.HTTP_404_NOT_FOUND,
+ detail={"reason": "not_found", "message": "Task Instance not
found"},
+ )
+
+ # Reuse the public API note logic so both editing paths stay consistent. A
None/empty note
+ # from runtime clears it (removes the row), matching the UI/public API.
Runtime notes carry no
+ # acting user, so they are stored unattributed (user_id=None).
+ patch_dag_run_note(dag_run=dag_run, note=body.note or "", user_id=None)
Review Comment:
Fixed. `note=None` now leaves the existing DagRun note untouched, and only
`note=""` clears it. I updated the runtime route and added a regression test
covering the null no-op case.
##########
task-sdk/src/airflow/sdk/execution_time/schema/versions/v2026_06_16.py:
##########
@@ -0,0 +1,25 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""
+In-progress supervisor schema version.
+
+New supervisor message bodies introduced in the head schema do not need
field-level migration
+instructions for this first dated schema version.
+"""
+
+from __future__ import annotations
Review Comment:
Removed the no-op schema version file. The supervisor schema hooks still
pass without it.
--
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]