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

kaxilnaik 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 eb53d33142d Run providers compat test with Airflow 3.1 & fix compat 
(#56118)
eb53d33142d is described below

commit eb53d33142d3b8eba83ce51e707e686f277db214
Author: Kaxil Naik <[email protected]>
AuthorDate: Fri Sep 26 03:24:46 2025 +0100

    Run providers compat test with Airflow 3.1 & fix compat (#56118)
    
    Some compat layers were wrong! Fixed them while adding 3.1.0 to provider 
compat matrix
---
 dev/breeze/src/airflow_breeze/global_constants.py |  6 ++++++
 devel-common/src/tests_common/pytest_plugin.py    |  5 ++++-
 devel-common/src/tests_common/test_utils/db.py    | 14 ++++++++++----
 3 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/dev/breeze/src/airflow_breeze/global_constants.py 
b/dev/breeze/src/airflow_breeze/global_constants.py
index 6284fb8650d..ae201ea2a1b 100644
--- a/dev/breeze/src/airflow_breeze/global_constants.py
+++ b/dev/breeze/src/airflow_breeze/global_constants.py
@@ -793,6 +793,12 @@ PROVIDERS_COMPATIBILITY_TESTS_MATRIX: list[dict[str, str | 
list[str]]] = [
         "remove-providers": "",
         "run-unit-tests": "true",
     },
+    {
+        "python-version": "3.10",
+        "airflow-version": "3.1.0",
+        "remove-providers": "",
+        "run-unit-tests": "true",
+    },
 ]
 
 ALL_PYTHON_VERSION_TO_PATCHLEVEL_VERSION: dict[str, str] = {
diff --git a/devel-common/src/tests_common/pytest_plugin.py 
b/devel-common/src/tests_common/pytest_plugin.py
index cf3b3a46b74..6734c215225 100644
--- a/devel-common/src/tests_common/pytest_plugin.py
+++ b/devel-common/src/tests_common/pytest_plugin.py
@@ -1175,7 +1175,10 @@ def dag_maker(request) -> Generator[DagMaker, None, 
None]:
 
         def sync_dagbag_to_db(self):
             if AIRFLOW_V_3_1_PLUS:
-                from airflow.dag_processing.dagbag import sync_bag_to_db
+                try:
+                    from airflow.dag_processing.dagbag import sync_bag_to_db
+                except ImportError:
+                    from airflow.models.dagbag import sync_bag_to_db
 
                 sync_bag_to_db(self.dagbag, self.bundle_name, None)
             elif AIRFLOW_V_3_0_PLUS:
diff --git a/devel-common/src/tests_common/test_utils/db.py 
b/devel-common/src/tests_common/test_utils/db.py
index dc3e86a62d9..6f6e1c3e86d 100644
--- a/devel-common/src/tests_common/test_utils/db.py
+++ b/devel-common/src/tests_common/test_utils/db.py
@@ -105,8 +105,11 @@ def _bootstrap_dagbag():
 
         dagbag = DagBag()
         # Save DAGs in the ORM
-        if AIRFLOW_V_3_2_PLUS:
-            from airflow.dag_processing.dagbag import sync_bag_to_db
+        if AIRFLOW_V_3_1_PLUS:
+            try:
+                from airflow.dag_processing.dagbag import sync_bag_to_db
+            except ImportError:
+                from airflow.models.dagbag import sync_bag_to_db
 
             sync_bag_to_db(dagbag, bundle_name="dags-folder", 
bundle_version=None, session=session)
         elif AIRFLOW_V_3_0_PLUS:
@@ -180,8 +183,11 @@ def parse_and_sync_to_db(folder: Path | str, 
include_examples: bool = False):
             session.flush()
 
         dagbag = DagBag(dag_folder=folder, include_examples=include_examples)
-        if AIRFLOW_V_3_2_PLUS:
-            from airflow.dag_processing.dagbag import sync_bag_to_db
+        if AIRFLOW_V_3_1_PLUS:
+            try:
+                from airflow.dag_processing.dagbag import sync_bag_to_db
+            except ImportError:
+                from airflow.models.dagbag import sync_bag_to_db  # type: 
ignore[no-redef, attribute-defined]
 
             sync_bag_to_db(dagbag, "dags-folder", None, session=session)
         elif AIRFLOW_V_3_0_PLUS:

Reply via email to