Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airflow/models/mappedoperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def _expand(self, **mapped_kwargs: "Mappable") -> "MappedOperator":
from airflow.operators.empty import EmptyOperator

validate_mapping_kwargs(self.operator_class, "expand", mapped_kwargs)
prevent_duplicates(self.kwargs, mapped_kwargs, fail_reason="mapping already partial")
prevent_duplicates(self.kwargs, mapped_kwargs, fail_reason="unmappable or already specified")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
prevent_duplicates(self.kwargs, mapped_kwargs, fail_reason="unmappable or already specified")
prevent_duplicates(self.kwargs, mapped_kwargs, fail_reason="unmappable or already specified (see https://airflow.apache.org/docs/apache-airflow/stable/concepts/dynamic-task-mapping.html#mapping-with-non-taskflow-operators )")

Don't we want to direct the user to the exact place in the docs where more context and details is explained? I think that would be an empathetic bahaviour towards the users who see it for the very first time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can even create a short link for it:

Suggested change
prevent_duplicates(self.kwargs, mapped_kwargs, fail_reason="unmappable or already specified")
prevent_duplicates(self.kwargs, mapped_kwargs, fail_reason="unmappable or already specified (see https://s.apache.org/airflow-unmappable) ")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I don’t like putting documentation links in the error message. We could make this more prominent in the documentation page though, perhaps adding a section with the error message in the title.

ensure_xcomarg_return_value(mapped_kwargs)

partial_kwargs = self.kwargs.copy()
Expand Down