diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a25e84b9e9..b8a1a35eb0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -356,19 +356,12 @@ jobs: python-version: [ "3.11" ] airflow-version: [ "2.10", "3.0" ] dbt-version: ["1.5", "1.6", "1.7", "1.8", "1.9"] - # TODO: Add support for dbt 1.6, 1.7, 1.9 for Airflow 3.0. + # TODO: Add support for dbt 1.7 for Airflow 3.0. # Issue dbt 1.7: https://github.com/astronomer/astronomer-cosmos/issues/1709 - # Issue dbt 1.6 and 1.9: https://github.com/astronomer/astronomer-cosmos/issues/1708 exclude: - - python-version: "3.11" - airflow-version: "3.0" - dbt-version: "1.6" - python-version: "3.11" airflow-version: "3.0" dbt-version: "1.7" - - python-version: "3.11" - airflow-version: "3.0" - dbt-version: "1.9" services: postgres: image: postgres diff --git a/scripts/test/integration-dbt-async.sh b/scripts/test/integration-dbt-async.sh index d4f1d49c08..eefce0bb97 100644 --- a/scripts/test/integration-dbt-async.sh +++ b/scripts/test/integration-dbt-async.sh @@ -11,6 +11,19 @@ echo "$DBT_VERSION" pip uninstall dbt-adapters dbt-common dbt-core dbt-extractor dbt-postgres dbt-semantic-interfaces -y pip install "dbt-postgres==$DBT_VERSION" "dbt-databricks==$DBT_VERSION" "dbt-bigquery==$DBT_VERSION" + +# apache-airflow-core 3.0.0 requires pydantic>=2.11.0, but the above dbt adapters in case of version 1.6 and 1.9 install +# pydantic 1.10.22 which make it incompatible. +# With pydantic 1.10.22 we get the below error +# File "<...>/hatch/env/virtual/astronomer-cosmos/D9FI7Men/tests.py3.11-3.0-1.6/lib/python3.11/site-packages/cadwyn/_utils.py", line 5, in +# from pydantic._internal._decorators import unwrap_wrapped_function +# ModuleNotFoundError: No module named 'pydantic._internal' +# Hence, we re-install pydantic with the required minimum version after installing dbt adapters. +if [ "$DBT_VERSION" = "1.6" ] || [ "$DBT_VERSION" = "1.9" ]; then + echo "DBT_VERSION is $DBT_VERSION, installing pydantic>=2.11.0 for apache-airflow-core compatibility." + pip install "pydantic>2.11.0" +fi + export SOURCE_RENDERING_BEHAVIOR=all rm -rf airflow.*