diff --git a/Makefile b/Makefile index 96305c4bfb..40874f7972 100644 --- a/Makefile +++ b/Makefile @@ -36,11 +36,16 @@ install-dev-dbt-%: if [ "$$version" = "1.10.0" ]; then \ echo "Applying special handling for dbt 1.10.0"; \ $(SED_INPLACE) -E 's/"(dbt-core)[^"]*"/"\1~='"$$version"'"/g' pyproject.toml; \ - $(SED_INPLACE) -E 's/"(dbt-(bigquery|duckdb|snowflake|athena-community|clickhouse|databricks|redshift|trino))[^"]*"/"\1"/g' pyproject.toml; \ + $(SED_INPLACE) -E 's/"(dbt-(bigquery|duckdb|snowflake|athena-community|clickhouse|redshift|trino))[^"]*"/"\1"/g' pyproject.toml; \ + $(SED_INPLACE) -E 's/"(dbt-databricks)[^"]*"/"\1~='"$$version"'"/g' pyproject.toml; \ else \ echo "Applying version $$version to all dbt packages"; \ $(SED_INPLACE) -E 's/"(dbt-[^"><=~!]+)[^"]*"/"\1~='"$$version"'"/g' pyproject.toml; \ fi; \ + if printf '%s\n' "$$version" | awk -F. '{ if ($$1 == 1 && (($$2 >= 3 && $$2 <= 5) || $$2 == 10)) exit 0; exit 1 }'; then \ + echo "Applying numpy<2 constraint for dbt $$version"; \ + $(SED_INPLACE) 's/"numpy"/"numpy<2"/g' pyproject.toml; \ + fi; \ $(MAKE) install-dev; \ if [ "$$version" = "1.6.0" ]; then \ echo "Applying overrides for dbt 1.6.0"; \ @@ -50,6 +55,10 @@ install-dev-dbt-%: echo "Applying overrides for dbt 1.7.0"; \ $(PIP) install 'databricks-sdk==0.28.0' --reinstall; \ fi; \ + if [ "$$version" = "1.5.0" ]; then \ + echo "Applying overrides for dbt 1.5.0"; \ + $(PIP) install 'dbt-databricks==1.5.6' 'numpy<2' --reinstall; \ + fi; \ mv pyproject.toml.backup pyproject.toml; \ echo "Restored original pyproject.toml" diff --git a/pyproject.toml b/pyproject.toml index bd34906434..1d34b340b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,6 +76,7 @@ dev = [ "google-cloud-bigquery-storage", "httpx", "mypy~=1.13.0", + "numpy", "pandas-stubs", "pre-commit", "psycopg2-binary",