Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.

Commit

Permalink
Fix tests (#63)
Browse files Browse the repository at this point in the history
Since merging #61 and #62, tests started breaking due to several dependencies conflicts.
This PR introduces the usage of constraints for Airflow 2.3 onwards, to avoid these conflicts.
  • Loading branch information
tatiana authored Feb 23, 2024
1 parent 42a1da2 commit c83e03c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,15 @@ def test(session: nox.Session, airflow) -> None:
"AIRFLOW__CORE__ALLOWED_DESERIALIZATION_CLASSES": "airflow\\.* astro\\.* astro_databricks\\.*",
}

# Workaround to the issue:
# RuntimeError: The package `apache-airflow-providers-databricks:4.2.0` requires Apache Airflow 2.4.0+
if version.parse(airflow) < version.parse("2.4"):
if version.parse(airflow) == version.parse("2.2.4"):
# constraints file raised a few exceptions for Airflow 2.2.4
session.install("apache-airflow-providers-databricks<4.2")

session.install(f"apache-airflow=={airflow}")
session.run("pip", "uninstall", "apache-airflow-providers-common-io", "-y")
else:
session.install(f"apache-airflow[databricks]=={airflow}", "--constraint", f"https://raw.githubusercontent.com/apache/airflow/constraints-{airflow}.0/constraints-{session.python}.txt")
session.install("-e", ".[tests]")
session.install(f"apache-airflow=={airflow}")


# Log all the installed dependencies
session.log("Installed Dependencies:")
Expand Down

0 comments on commit c83e03c

Please sign in to comment.