gyli commented on code in PR #47592:
URL: https://github.com/apache/airflow/pull/47592#discussion_r2238144176
##########
devel-common/src/tests_common/pytest_plugin.py:
##########
@@ -1856,15 +1856,20 @@ def hook_lineage_collector():
@pytest.fixture
-def clean_dags_and_dagruns():
+def clean_dags_dagruns_and_dagbundles():
"""Fixture that cleans the database before and after every test."""
- from tests_common.test_utils.db import clear_db_dags, clear_db_runs
+ from tests_common.test_utils.db import clear_db_dag_bundles,
clear_db_dags, clear_db_runs
+ from tests_common.test_utils.version_compat import AIRFLOW_V_3_0_PLUS
clear_db_runs()
clear_db_dags()
+ if AIRFLOW_V_3_0_PLUS:
+ clear_db_dag_bundles()
Review Comment:
Could you plz elaborate on this? By checking the [function
definition](https://github.com/apache/airflow/blob/main/devel-common/src/tests_common/test_utils/db.py#L319)
and the [migration file of
DagBundle](https://github.com/apache/airflow/blob/0cd0ff0872cea4dffa088a88b54001d157de6e8e/airflow-core/src/airflow/migrations/versions/0050_3_0_0_add_dagbundlemodel.py#L44),
I think the function and the model exist with 3.0.x.
Actually, AIRFLOW_V_3_0_PLUG is used as the condition for
`clear_db_dag_bundles` in other places as well, like
[here](https://github.com/apache/airflow/blob/main/devel-common/src/tests_common/test_utils/db.py#L356).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]