potiuk commented on PR #25780:
URL: https://github.com/apache/airflow/pull/25780#issuecomment-1219386764

   I pushed fixes (I still need to add more tests).  
   
   Unfortunately it seems that the `mypy` instabilitites are a bit different 
nature. As explained in the comment above for some reason it started to 
complain with those errors:
   
   ```
   airflow/operators/python.py:277: error: Argument 3 to "skip" of "SkipMixin" 
has
   incompatible type "Collection[Union[BaseOperator, MappedOperator]]"; expected
   "Sequence[BaseOperator]"  [arg-type]
                       self.skip(dag_run, execution_date, downstream_tasks)
                                                          ^
   airflow/operators/python.py:282: error: Argument 3 to "skip" of "SkipMixin" 
has
   incompatible type "Iterable[DAGNode]"; expected "Sequence[BaseOperator]"
   [arg-type]
       ...              self.skip(dag_run, execution_date, 
context["task"].get_d...
                                                           ^
   Found 2 errors in 1 file (checked 1 source file)
   ```
   
   I looked at it closely and I think the suggestions from MyPy were actually 
correct. I could not find any reason why get_direct_relatives should return 
DAGNode, as far as I can tell you cannot get TaskGroups  - you only get tasks 
so `Union[BaseOperator, MappedOperator]' (and you cannot skip TaskGroup 
either). Also Collection was not right, because tasks[0] was used in the 'skip' 
method:
   
   ```
    DagRun.dag_id == tasks[0].dag_id,
   ```
   
   So looks like somethign "masked" the problems from MyPy before and we should 
fix it here.  Any insights and confirmation of my findings would be appreciated 
before I add more tests.


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