This is an automated email from the ASF dual-hosted git repository.
potiuk 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 a80b2fcaea Modify db clean to also catch the ProgrammingError
exception (#23699)
a80b2fcaea is described below
commit a80b2fcaea984813995d4a2610987a1c9068fdb5
Author: Jian Yuan Lee <[email protected]>
AuthorDate: Thu May 19 17:47:56 2022 +0100
Modify db clean to also catch the ProgrammingError exception (#23699)
---
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