Skip to content

Commit

Permalink
Replace assert by if...raise in www package (#34249)
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-awala committed Sep 9, 2023
1 parent 7efc68c commit 7b4fc39
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion airflow/www/views.py
Expand Up @@ -2287,7 +2287,11 @@ def _clear_dag_tis(
except AirflowException as ex:
return redirect_or_json(origin, msg=str(ex), status="error", status_code=500)

assert isinstance(tis, collections.abc.Iterable)
if not isinstance(tis, collections.abc.Iterable):
raise AssertionError(
f"Expected dag.clear() to return an iterable for dry runs, got {tis} instead."
)

details = [str(t) for t in tis]

if not details:
Expand Down

0 comments on commit 7b4fc39

Please sign in to comment.