This is an automated email from the ASF dual-hosted git repository.

husseinawala pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 7b4fc3933b Replace assert by if...raise in www package (#34249)
7b4fc3933b is described below

commit 7b4fc3933bd1bbcf79acef32f00ba8981ea271b3
Author: Hussein Awala <[email protected]>
AuthorDate: Sat Sep 9 23:09:18 2023 +0200

    Replace assert by if...raise in www package (#34249)
---
 airflow/www/views.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/airflow/www/views.py b/airflow/www/views.py
index 8be5bb1ed1..bd4efb211c 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -2287,7 +2287,11 @@ class Airflow(AirflowBaseView):
         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:

Reply via email to