ephraimbuddy commented on code in PR #22679:
URL: https://github.com/apache/airflow/pull/22679#discussion_r842646061


##########
airflow/models/dagrun.py:
##########
@@ -839,25 +839,43 @@ def task_filter(task: "Operator") -> bool:
 
         if hook_is_noop:
 
-            def create_ti_mapping(task: "Operator") -> dict:
-                created_counts[task.task_type] += 1
-                return TI.insert_mapping(self.run_id, task, map_index=-1)
+            def create_ti_mapping(task: "Operator") -> List[dict]:
+                if isinstance(task, MappedOperator):

Review Comment:
   Have type ignored it.
   ```
   airflow/models/dagrun.py:828: error: Item "BaseOperator" of
   "Union[BaseOperator, MappedOperator]" has no attribute
   "mapped_args_are_literals"  [union-attr]
                   if task.is_mapped and task.mapped_args_are_literals:
                                         ^
   airflow/models/dagrun.py:830: error: Item "BaseOperator" of
   "Union[BaseOperator, MappedOperator]" has no attribute "x"  [union-attr]
                       if ti.map_index >= task.x:
                                          ^
   airflow/models/dagrun.py:870: note: Revealed type is 
"Union[airflow.models.baseoperator.BaseOperator, 
airflow.models.mappedoperator.MappedOperator]"
   airflow/models/dagrun.py:871: error: Item "BaseOperator" of
   "Union[BaseOperator, MappedOperator]" has no attribute
   "mapped_args_are_literals"  [union-attr]
                   if not task.is_mapped or not task.mapped_args_are_literals...
                                                ^
   airflow/models/dagrun.py:873: error: Incompatible return value type (got
   "Tuple[Union[BaseOperator, MappedOperator], range]", expected
   "Tuple[Union[BaseOperator, MappedOperator], Tuple[int, ...]]")  
[return-value]
                   return (task, range(task.x))
                           ^
   airflow/models/dagrun.py:873: error: Item "BaseOperator" of
   "Union[BaseOperator, MappedOperator]" has no attribute "x"  [union-attr]
                   return (task, range(task.x))
                                       ^
   Found 5 errors in 1 file (checked 1 source file)
   
   ERROR: The previous step completed with error. Please take a look at output 
above 
   ```



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