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


##########
providers/huggingface/docs/operators/datasets.rst:
##########
@@ -189,21 +189,20 @@ the same artifact to another target is a separate 
publication. Airflow 3.3 and
 later task state store support caches the result and records that a push may
 have started. A retry searches the intended branch or pull request ref only
 after that record exists, and only reuses the latest commit without a generated
-suffix carrying the marker. Clearing a task preserves this state on Airflow
-3.3. On Airflow 3.4, clearing a Dag run also preserves it; clearing an
-individual task instance removes it only when ``keep_task_state`` is off. In
-the cases that preserve state, a cleared task can return the stored commit and
-emit its asset event again without pushing. This avoids reusing an older
-publication after the branch has advanced. The task
-emits an asset event with the same commit SHA and URL only after successful
-publication. Publication uses Datasets ``push_to_hub``, which rewrites the
-README's YAML card metadata, including ``dataset_info`` and ``configs``, in the
-push commit. Only a publication to ``main`` without ``create_pr`` emits the
-repo-level asset event; pull request and non-main revision pushes do not change
-the revision referenced by ``hf://datasets/<repo_id>``. For those pushes the
-operator removes ``hf://datasets/<repo_id>`` from ``outlets`` even when you 
list
-it there yourself, and in a mapped task this follows each expanded
-``push_kwargs`` entry.
+suffix carrying the marker. Clearing a task removes this state by default: from
+the UI or the REST API from Airflow 3.4, and on every other clear from Airflow
+3.5. If you set ``keep_task_state`` when clearing, a cleared task can return
+the stored commit and emit its asset event again without pushing. This avoids

Review Comment:
   3dba0f97476



##########
providers/databricks/docs/operators/run_now.rst:
##########
@@ -142,15 +142,45 @@ stored, so a retry that comes later than that finds 
nothing and triggers a fresh
 reconnecting, whatever schedule ``airflow state-store clean`` runs on. Size 
that setting against
 your longest ``retry_delay``.
 
-Clearing a task discards the stored run id by default, so the next attempt 
triggers a fresh run.
-Set ``keep_task_state`` when clearing to keep it instead, and the attempt is 
then treated the same
-as a retry: for a task whose run already succeeded, it reads the run back and 
returns immediately
-without triggering a new one. 
:doc:`apache-airflow:core-concepts/resumable-tasks` lists which
-clear paths discard the id and describes the ``[state_store] 
clear_on_success`` setting.
-
-This is most reliable for deferred tasks (``deferrable=True``); clearing a 
task that's actively
-polling synchronously can cancel the run via ``on_kill`` before the next 
attempt gets a chance to
-reconnect -- see :doc:`apache-airflow:core-concepts/resumable-tasks` for why.
+Clearing a task instance from the UI or the REST API (so ``airflowctl`` too) 
deletes the stored run
+id by default from Airflow 3.4. Every other clear, such as ``airflow tasks 
clear`` or clearing a
+whole Dag run, does so from Airflow 3.5. To keep it, tick **Keep task state 
and resume** in the
+Clear dialog, or send ``"keep_task_state": true`` in the request. The **Keep 
task state on clear**
+UI setting ticks that box by default. From Airflow 3.5, ``airflow tasks clear 
--keep-task-state``
+keeps it too. The next attempt then reads the stored run id back. In 
synchronous mode, what the next
+attempt does depends on the state of the Databricks run at that point:
+
+.. list-table::
+   :header-rows: 1
+   :widths: 20 40 40
+
+   * - Run state
+     - Default clear
+     - Clear that keeps task state
+   * - Still running (the task had already failed, or its worker died)
+     - Triggers a new job run. The first one keeps running, unless 
``cancel_previous_runs=True``
+       cancels it first.
+     - Reconnects to the running run.
+   * - Succeeded
+     - Triggers a new job run.
+     - Returns right away without triggering another one.
+   * - Failed or canceled
+     - Triggers a new job run.
+     - Triggers a new job run.
+
+With ``deferrable=True``, the operator does not store the run id, so the next 
attempt triggers a
+new job run whether or not task state was kept.
+
+With ``[state_store] clear_on_success`` on, the stored run id is deleted when 
the task succeeds, so
+clearing a succeeded task submits again even when task state is kept.
+
+Keep task state when a run is still running and nothing about the code or 
inputs changed, so
+you don't pay for two. This assumes the run survives the clear; keeping task 
state does not
+prevent cancellation via ``on_kill``. See 
:doc:`apache-airflow:core-concepts/resumable-tasks`
+for the ways of clearing.
+
+Clearing a task that is still running cancels the run via ``on_kill``, also 
when the task is
+deferred, so the next attempt finds it canceled.

Review Comment:
   3dba0f97476



##########
providers/common/ai/docs/frameworks/strands.rst:
##########
@@ -221,8 +221,8 @@ A retry runs some work again:
   or keep sandbox work out of a durable agent.
 
 A retry resumes the saved conversation with the system prompt it was saved 
with.
-So does clearing the whole Dag run, which keeps task state. To run a changed 
system
-prompt on a failed task, clear the task itself without keeping its task state.
+So does a clear that keeps task state. To run a changed system prompt on a 
failed
+task, clear it without keeping its task state, which is the default.

Review Comment:
   3dba0f97476



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