fweilun commented on issue #52219:
URL: https://github.com/apache/airflow/issues/52219#issuecomment-3018794579

   Hi, I'm currently working on this issue.
   
   I found that Skipping tasks [] is empty because the line below in 
SkipMixin::skip_all_except filters out all operators except MappedOperator and 
BaseOperator:
   `
   downstream_tasks = _ensure_tasks(task.downstream_list)
   `
   However, BaseSensorOperator from airflow.sdk.bases.sensor.BaseSensorOperator 
is not recognized as a BaseOperator due to differing module origins, even 
though it nominally inherits from BaseOperator. As a result, tasks like 
SqlSensor (which subclass BaseSensorOperator) are excluded from 
downstream_tasks, and Skipping tasks [], which is derived from 
downstream_tasks, ends up empty.
   
   
   Below is the log. task_1 is filtered out in line 11-12.
   <img width="829" alt="Image" 
src="https://github.com/user-attachments/assets/334e9838-ef1f-4016-b73a-900d05b9fdc0";
 />
   
   
   I temporarily added BaseSensorOperator to _ensure_tasks() as a workaround, 
and it resolved the issue:
   
   
   adjusted code:
   ```python
   def _ensure_tasks(nodes: Iterable[DAGNode]) -> Sequence[Operator]:
       from airflow.models.baseoperator import BaseOperator
       from airflow.models.mappedoperator import MappedOperator
       from airflow.sensors.base import BaseSensorOperator
       return [n for n in nodes if isinstance(n, (BaseOperator, MappedOperator, 
BaseSensorOperator))]
   ```
   
   Does this seem like the right direction?
   Would appreciate any guidance on whether _ensure_tasks() should be updated 
to support SDK-based operators, or if there’s a better approach moving forward.
   
   Thanks!


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