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

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


The following commit(s) were added to refs/heads/master by this push:
     new dd5c5d9  Remove duplicated clean_db function for ImportErrors (#14296)
dd5c5d9 is described below

commit dd5c5d9741c243d665d51d1441e286259ff725b0
Author: Ash Berlin-Taylor <[email protected]>
AuthorDate: Tue Feb 23 09:22:26 2021 +0000

    Remove duplicated clean_db function for ImportErrors (#14296)
    
    There were two functions -- clean_db_errors and clean_db_import_errors
    that did the same thing.
---
 tests/jobs/test_scheduler_job.py  | 8 ++++----
 tests/models/test_taskinstance.py | 2 +-
 tests/test_utils/db.py            | 5 -----
 3 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/tests/jobs/test_scheduler_job.py b/tests/jobs/test_scheduler_job.py
index 3867833..d63a534 100644
--- a/tests/jobs/test_scheduler_job.py
+++ b/tests/jobs/test_scheduler_job.py
@@ -59,7 +59,7 @@ from tests.test_utils.asserts import assert_queries_count
 from tests.test_utils.config import conf_vars, env_vars
 from tests.test_utils.db import (
     clear_db_dags,
-    clear_db_errors,
+    clear_db_import_errors,
     clear_db_jobs,
     clear_db_pools,
     clear_db_runs,
@@ -106,7 +106,7 @@ class TestDagFileProcessor(unittest.TestCase):
         clear_db_pools()
         clear_db_dags()
         clear_db_sla_miss()
-        clear_db_errors()
+        clear_db_import_errors()
         clear_db_jobs()
         clear_db_serialized_dags()
 
@@ -781,7 +781,7 @@ class TestSchedulerJob(unittest.TestCase):
         clear_db_pools()
         clear_db_dags()
         clear_db_sla_miss()
-        clear_db_errors()
+        clear_db_import_errors()
 
         # Speed up some tests by not running the tasks, just look at what we
         # enqueue!
@@ -4001,7 +4001,7 @@ class TestSchedulerJobQueriesCount(unittest.TestCase):
         clear_db_pools()
         clear_db_dags()
         clear_db_sla_miss()
-        clear_db_errors()
+        clear_db_import_errors()
         clear_db_serialized_dags()
         clear_db_dags()
 
diff --git a/tests/models/test_taskinstance.py 
b/tests/models/test_taskinstance.py
index cd99b02..18ae2ce 100644
--- a/tests/models/test_taskinstance.py
+++ b/tests/models/test_taskinstance.py
@@ -2027,7 +2027,7 @@ class TestRunRawTaskQueriesCount(unittest.TestCase):
         db.clear_db_pools()
         db.clear_db_dags()
         db.clear_db_sla_miss()
-        db.clear_db_errors()
+        db.clear_db_import_errors()
 
     def setUp(self) -> None:
         self._clean()
diff --git a/tests/test_utils/db.py b/tests/test_utils/db.py
index cfc4368..93881f5 100644
--- a/tests/test_utils/db.py
+++ b/tests/test_utils/db.py
@@ -60,11 +60,6 @@ def clear_db_sla_miss():
         session.query(SlaMiss).delete()
 
 
-def clear_db_errors():
-    with create_session() as session:
-        session.query(errors.ImportError).delete()
-
-
 def clear_db_pools():
     with create_session() as session:
         session.query(Pool).delete()

Reply via email to