Skip to content

Commit

Permalink
Clarify .deps TypeError message
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Mar 1, 2022
1 parent e26864b commit 9132d7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion airflow/models/mappedoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ def get_serialized_fields(cls):
def deps_for(operator_class: Type["BaseOperator"]) -> FrozenSet[BaseTIDep]:
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")
raise UnmappableOperator(
f"'deps' must be a set defined as a class-level variable on {operator_class.__name__}, "
f"not a {type(operator_deps).__name__}"
)
return operator_deps | {MappedTaskIsExpanded()}

def _validate_argument_count(self) -> None:
Expand Down

0 comments on commit 9132d7a

Please sign in to comment.