Skip to content

Commit

Permalink
Better error message where non-compatible providers are not excluded (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
potiuk authored Apr 13, 2023
1 parent 312f7e8 commit 916dd96
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions scripts/docker/entrypoint_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 916dd96

Please sign in to comment.