uranusjr commented on code in PR #75874:
URL: https://github.com/apache/airflow/pull/75874#discussion_r4522442663


##########
providers/standard/src/airflow/providers/standard/sensors/external_task.py:
##########
@@ -755,6 +789,60 @@ def __init__(
             raise ValueError("recursion_depth should be a positive integer")
         self.recursion_depth = recursion_depth
 
+    @property
+    def inherits_from_empty_operator(self) -> bool:  # type: ignore[override]
+        # The marker only needs a worker when Airflow can follow a target and 
has to render it first.
+        return ExternalClearTarget is None or self.external_clear_target is 
not None

Review Comment:
   Mapped markers run on a worker only because `OperatorPartial._expand` reads 
the attribute on the class and use `is True`. This is accidentally correct (the 
value is a `property` object on the class), but would silently break if someone 
wants to rewrite either side with faily common Python idioms.



##########
airflow-core/newsfragments/75874.significant.rst:
##########
@@ -0,0 +1,16 @@
+Clearing a task with its downstream tasks clears its ``ExternalTaskMarker`` 
targets in other Dags again
+
+As in Airflow 2, clearing a task instance with its downstream tasks also 
clears the task its
+``ExternalTaskMarker`` points at, and that task's downstream tasks, in the 
other Dag. This applies to the
+task instance clear endpoint and the task instance clear dialogs; clearing a 
whole Dag run does not cascade.
+
+To keep a clear inside one Dag, untick "Clear tasks in dependent Dags" in the 
clear dialog, or send
+``include_dependent_dags: false`` to ``POST 
/api/v2/dags/{dag_id}/clearTaskInstances``. Left unset, it
+follows ``include_downstream``.
+
+With a release of ``apache-airflow-providers-standard`` that supports this, an 
``ExternalTaskMarker`` whose
+target needs no rendering is stored with the Dag version and still never runs. 
A marker with a templated
+``external_dag_id``, ``external_task_id`` or ``logical_date`` runs on a worker 
instead, where its templates
+render, so it uses a worker slot on every run. A templated marker reports its 
target only when it succeeds,
+so clearing a run where it has not succeeded (it failed, or an upstream task 
did) does not cascade. A run on
+a Dag version serialized before the upgrade does not cascade either.

Review Comment:
   Since the attempt fallback, an earlier successful attempt's report is used. 
This should say "has never succeeded".



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