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


##########
airflow/models/mappedoperator.py:
##########
@@ -677,3 +677,18 @@ def _find_index_for_this_field(index: int) -> int:
             if i == found_index:
                 return k, v
         raise IndexError(f"index {map_index} is over mapped length")
+
+    @cached_property
+    def mapped_args_are_literals(self) -> bool:
+        """Are all the mapped arguments to this class static literals"""
+        expansion_kwargs = self._get_expansion_kwargs()
+
+        return all(isinstance(item, (list, dict)) for item in 
expansion_kwargs.values())
+
+    @cached_property
+    def mapped_args_count(self) -> int:
+        """Count the length of the mapped arguments to this class"""
+        from airflow.models.xcom_arg import XComArg
+
+        expansion_kwargs = self._get_expansion_kwargs()
+        return sum(len(item) for item in expansion_kwargs.values() if not 
isinstance(item, XComArg))

Review Comment:
   Because of the use in the "check for removed or restored tasks" block 
earlier in `verify_integrity` I can't have the expansion here -- we need a 
count available to DagRun



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