Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify db clean to also catch the ProgrammingError exception
Browse files Browse the repository at this point in the history
jianyuan committed May 16, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent cd9d935 commit 0879d3f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions airflow/utils/db_cleanup.py
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@

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 @@ def __enter__(self):
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

0 comments on commit 0879d3f

Please sign in to comment.