You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2024/03/31 15:57:28 UTC
(airflow) 03/19: Avoid accidentally upgrading airflow in compatibility check (#38545)
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-9-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit b55aac8a88ae5801a4413357c16e962460381feb
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Thu Mar 28 01:02:45 2024 +0100
Avoid accidentally upgrading airflow in compatibility check (#38545)
When running compatibility check of providers with airflow, we install
airflow first (with constraints) and providers as the next step (without
constraints). This might - in some cases lead to accidental upgrade of
airflow if `pip` decides to do so.
By adding airflow package to the list of providers to install, we will
keep it from being accidentally upgraded.
(cherry picked from commit c855f1f54ac2d5f11689592964aa6f665bac4d33)
---
dev/breeze/src/airflow_breeze/global_constants.py | 5 -----
scripts/in_container/install_airflow_and_providers.py | 6 ++++++
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/dev/breeze/src/airflow_breeze/global_constants.py b/dev/breeze/src/airflow_breeze/global_constants.py
index bc469fb82d..745913e038 100644
--- a/dev/breeze/src/airflow_breeze/global_constants.py
+++ b/dev/breeze/src/airflow_breeze/global_constants.py
@@ -472,11 +472,6 @@ BASE_PROVIDERS_COMPATIBILITY_CHECKS: list[dict[str, str]] = [
"airflow-version": "2.6.0",
"remove-providers": _exclusion(["openlineage", "common.io", "cohere", "fab", "qdrant"]),
},
- {
- "python-version": "3.9",
- "airflow-version": "2.6.0",
- "remove-providers": _exclusion(["openlineage", "common.io", "fab", "qdrant"]),
- },
{
"python-version": "3.8",
"airflow-version": "2.7.1",
diff --git a/scripts/in_container/install_airflow_and_providers.py b/scripts/in_container/install_airflow_and_providers.py
index 5e27d79e84..1174474e2e 100755
--- a/scripts/in_container/install_airflow_and_providers.py
+++ b/scripts/in_container/install_airflow_and_providers.py
@@ -500,6 +500,12 @@ def install_airflow_and_providers(
for provider_package in installation_spec.provider_packages:
base_install_providers_cmd.append(provider_package)
install_providers_command = base_install_providers_cmd.copy()
+ # if airflow is also being installed we should add airflow to the base_install_providers_cmd
+ # to avoid accidentally upgrading airflow to a version that is different than installed in the
+ # previous step
+ if installation_spec.airflow_package:
+ base_install_providers_cmd.append(installation_spec.airflow_package)
+
if installation_spec.provider_constraints_location:
console.print(
f"[bright_blue]with constraints: {installation_spec.provider_constraints_location}\n"