kaxil commented on code in PR #75874:
URL: https://github.com/apache/airflow/pull/75874#discussion_r4541729282
##########
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:
Good catch, and that was on my side: I'd switched `_expand` to read the
class attribute. It now also checks `issubclass(operator_class,
SupportsExternalClearTarget)`, since a mapped task's target is only known once
it runs, so a mapped marker runs no matter how `inherits_from_empty_operator`
is written. Added a case to
`test_mapped_operator_reads_inherits_from_empty_operator` for an empty subclass
that keeps `inherits_from_empty_operator = True` but reports a target.
--
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]