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

vincbeck 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 d07e66a562 Add trigger as a valid option for the db clean command 
(#34908)
d07e66a562 is described below

commit d07e66a5624faa28287ba01aad7e41c0f91cc1e8
Author: Syed Hussain <[email protected]>
AuthorDate: Mon Oct 30 10:09:58 2023 -0700

    Add trigger as a valid option for the db clean command (#34908)
---
 airflow/utils/db_cleanup.py    | 1 +
 tests/utils/test_db_cleanup.py | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/airflow/utils/db_cleanup.py b/airflow/utils/db_cleanup.py
index 4e3f3e1510..94956e1356 100644
--- a/airflow/utils/db_cleanup.py
+++ b/airflow/utils/db_cleanup.py
@@ -118,6 +118,7 @@ config_list: list[_TableConfig] = [
     _TableConfig(table_name="callback_request", 
recency_column_name="created_at"),
     _TableConfig(table_name="celery_taskmeta", 
recency_column_name="date_done"),
     _TableConfig(table_name="celery_tasksetmeta", 
recency_column_name="date_done"),
+    _TableConfig(table_name="trigger", recency_column_name="created_date"),
 ]
 
 if conf.get("webserver", "session_backend") == "database":
diff --git a/tests/utils/test_db_cleanup.py b/tests/utils/test_db_cleanup.py
index 55707bd315..7c600d237d 100644
--- a/tests/utils/test_db_cleanup.py
+++ b/tests/utils/test_db_cleanup.py
@@ -323,7 +323,6 @@ class TestDBCleanup:
             "ab_user",
             "variable",  # leave alone
             "dataset",  # not good way to know if "stale"
-            "trigger",  # self-maintaining
             "task_map",  # keys to TI, so no need
             "serialized_dag",  # handled through FK to Dag
             "log_template",  # not a significant source of data; age not 
indicative of staleness

Reply via email to