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

Commit c83e03c

Browse files
authored
Fix tests (#63)
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.
1 parent 42a1da2 commit c83e03c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

noxfile.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ def test(session: nox.Session, airflow) -> None:
3838
"AIRFLOW__CORE__ALLOWED_DESERIALIZATION_CLASSES": "airflow\\.* astro\\.* astro_databricks\\.*",
3939
}
4040

41-
# Workaround to the issue:
42-
# RuntimeError: The package `apache-airflow-providers-databricks:4.2.0` requires Apache Airflow 2.4.0+
43-
if version.parse(airflow) < version.parse("2.4"):
41+
if version.parse(airflow) == version.parse("2.2.4"):
42+
# constraints file raised a few exceptions for Airflow 2.2.4
4443
session.install("apache-airflow-providers-databricks<4.2")
45-
44+
session.install(f"apache-airflow=={airflow}")
45+
session.run("pip", "uninstall", "apache-airflow-providers-common-io", "-y")
46+
else:
47+
session.install(f"apache-airflow[databricks]=={airflow}", "--constraint", f"https://raw.githubusercontent.com/apache/airflow/constraints-{airflow}.0/constraints-{session.python}.txt")
4648
session.install("-e", ".[tests]")
47-
session.install(f"apache-airflow=={airflow}")
49+
4850

4951
# Log all the installed dependencies
5052
session.log("Installed Dependencies:")

0 commit comments

Comments
 (0)