Skip to content

Commit

Permalink
Replace assert by if...raise in decorators package (#34250)
Browse files Browse the repository at this point in the history
(cherry picked from commit 0470f3a)
  • Loading branch information
hussein-awala authored and ephraimbuddy committed Oct 5, 2023
1 parent 9f369ba commit c554233
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/decorators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c554233

Please sign in to comment.