ashb commented on a change in pull request #21815:
URL: https://github.com/apache/airflow/pull/21815#discussion_r815881591



##########
File path: airflow/models/mappedoperator.py
##########
@@ -284,7 +285,10 @@ def get_serialized_fields(cls):
     @staticmethod
     @cache
     def deps_for(operator_class: Type["BaseOperator"]) -> FrozenSet[BaseTIDep]:
-        return operator_class.deps | {MappedTaskIsExpanded()}
+        operator_deps = operator_class.deps
+        if not isinstance(operator_deps, collections.abc.Set):
+            raise UnmappableOperator(f"cannot map operator; 
f{operator_class}.deps must be a set")

Review comment:
       Can we be more explicit here -- if it is defined as a property to tell 
the user what is wrong as this could easily be confusing to the user if they 
have it as:
   
   ```python
       @property
       def deps(self):
          return {MyDep()}
   ```
   
   Because at first glance this _is_ a set.




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