diff --git a/airflow/decorators/base.py b/airflow/decorators/base.py index 2594ec23995f4..1a4bc06253895 100644 --- a/airflow/decorators/base.py +++ b/airflow/decorators/base.py @@ -523,7 +523,8 @@ def __attrs_post_init__(self): def _expand_mapped_kwargs(self, context: Context, session: Session) -> tuple[Mapping[str, Any], set[int]]: # We only use op_kwargs_expand_input so this must always be empty. - assert self.expand_input is EXPAND_INPUT_EMPTY + if self.expand_input is not EXPAND_INPUT_EMPTY: + raise AssertionError(f"unexpected expand_input: {self.expand_input}") op_kwargs, resolved_oids = super()._expand_mapped_kwargs(context, session) return {"op_kwargs": op_kwargs}, resolved_oids