From 916dd96691a6c9b0866ca63c864ebbec8872ba44 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Thu, 13 Apr 2023 19:14:16 +0200 Subject: [PATCH] Better error message where non-compatible providers are not excluded (#30629) When compatibility check is performed for old version of Airflow, we attempt to install all providers for the old version. However if one of the providers has >= limit on Airflow for newer version of Airflow, this installation lead to attempting to upgrade airflow rather than fail, which could lead to misleading errors. This change adds "airflow==x.y.z" taken from --use-airflow-version flag to the `pip install` command, which should in this case fail with much more accurate message, that the provider conflicts with airflo version. --- Dockerfile.ci | 6 ++++++ scripts/docker/entrypoint_ci.sh | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/Dockerfile.ci b/Dockerfile.ci index bd5f476ca3aa0..f56de8e486635 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -782,6 +782,12 @@ if [[ ${SKIP_ENVIRONMENT_INITIALIZATION=} != "true" ]]; then installable_files+=( "${file}" ) fi done + if [[ ${USE_AIRFLOW_VERSION} != "wheel" && ${USE_AIRFLOW_VERSION} != "sdist" && ${USE_AIRFLOW_VERSION} != "none" ]]; then + echo + echo "${COLOR_BLUE}Also adding airflow in specified version ${USE_AIRFLOW_VERSION} to make sure it is not upgraded by >= limits${COLOR_RESET}" + echo + installable_files+=( "apache-airflow==${USE_AIRFLOW_VERSION}" ) + fi if (( ${#installable_files[@]} )); then pip install --root-user-action ignore "${installable_files[@]}" fi diff --git a/scripts/docker/entrypoint_ci.sh b/scripts/docker/entrypoint_ci.sh index a3918e54124d7..b33faaf74be4c 100755 --- a/scripts/docker/entrypoint_ci.sh +++ b/scripts/docker/entrypoint_ci.sh @@ -206,6 +206,12 @@ if [[ ${SKIP_ENVIRONMENT_INITIALIZATION=} != "true" ]]; then installable_files+=( "${file}" ) fi done + if [[ ${USE_AIRFLOW_VERSION} != "wheel" && ${USE_AIRFLOW_VERSION} != "sdist" && ${USE_AIRFLOW_VERSION} != "none" ]]; then + echo + echo "${COLOR_BLUE}Also adding airflow in specified version ${USE_AIRFLOW_VERSION} to make sure it is not upgraded by >= limits${COLOR_RESET}" + echo + installable_files+=( "apache-airflow==${USE_AIRFLOW_VERSION}" ) + fi if (( ${#installable_files[@]} )); then pip install --root-user-action ignore "${installable_files[@]}" fi