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

ephraimanierobi pushed a commit to branch v2-3-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 91438f4dc0244d6fa29c8fe8372ad5fcc04ae17e
Author: Jian Yuan Lee <jiany...@gmail.com>
AuthorDate: Thu May 19 17:47:56 2022 +0100

    Modify db clean to also catch the ProgrammingError exception (#23699)
    
    (cherry picked from commit a80b2fcaea984813995d4a2610987a1c9068fdb5)
---
 airflow/utils/db_cleanup.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/airflow/utils/db_cleanup.py b/airflow/utils/db_cleanup.py
index 93e86c7825..b02d08503f 100644
--- a/airflow/utils/db_cleanup.py
+++ b/airflow/utils/db_cleanup.py
@@ -27,7 +27,7 @@ from typing import TYPE_CHECKING, Any, Dict, List, Optional, 
Union
 
 from pendulum import DateTime
 from sqlalchemy import and_, false, func
-from sqlalchemy.exc import OperationalError
+from sqlalchemy.exc import OperationalError, ProgrammingError
 
 from airflow.cli.simple_table import AirflowConsole
 from airflow.jobs.base_job import BaseJob
@@ -260,7 +260,7 @@ class _warn_if_missing(AbstractContextManager):
         return self
 
     def __exit__(self, exctype, excinst, exctb):
-        caught_error = exctype is not None and issubclass(exctype, 
OperationalError)
+        caught_error = exctype is not None and issubclass(exctype, 
(OperationalError, ProgrammingError))
         if caught_error:
             logger.warning("Table %r not found.  Skipping.", self.table)
         return caught_error

Reply via email to