Skip to content

Commit 5011741

Browse files
authored
chore: improve adapter compatibility old dbt releases (#5252)
1 parent a58dcf0 commit 5011741

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ install-dev-dbt-%:
4343
fi; \
4444
$(MAKE) install-dev; \
4545
if [ "$$version" = "1.6.0" ]; then \
46-
echo "Applying pydantic override for dbt 1.6.0"; \
47-
$(PIP) install 'pydantic>=2.0.0' --reinstall; \
46+
echo "Applying overrides for dbt 1.6.0"; \
47+
$(PIP) install 'pydantic>=2.0.0' 'google-cloud-bigquery==3.30.0' 'databricks-sdk==0.28.0' --reinstall; \
48+
fi; \
49+
if [ "$$version" = "1.7.0" ]; then \
50+
echo "Applying overrides for dbt 1.7.0"; \
51+
$(PIP) install 'databricks-sdk==0.28.0' --reinstall; \
4852
fi; \
4953
mv pyproject.toml.backup pyproject.toml; \
5054
echo "Restored original pyproject.toml"

tests/dbt/test_config.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from sqlmesh.core.dialect import jinja_query
1616
from sqlmesh.core.model import SqlModel
1717
from sqlmesh.core.model.kind import OnDestructiveChange, OnAdditiveChange
18+
from sqlmesh.dbt.builtin import Api
1819
from sqlmesh.dbt.column import ColumnConfig
1920
from sqlmesh.dbt.common import Dependencies
2021
from sqlmesh.dbt.context import DbtContext
@@ -1099,6 +1100,23 @@ def test_sqlmesh_model_kwargs_columns_override():
10991100
assert kwargs.get("columns") == {"c": exp.DataType.build(exp.DataType.Type.UINT)}
11001101

11011102

1103+
@pytest.mark.parametrize(
1104+
"dialect",
1105+
[
1106+
"databricks",
1107+
"duckdb",
1108+
"postgres",
1109+
"redshift",
1110+
"snowflake",
1111+
"bigquery",
1112+
"trino",
1113+
"clickhouse",
1114+
],
1115+
)
1116+
def test_api_class_loading(dialect: str):
1117+
Api(dialect)
1118+
1119+
11021120
def test_empty_vars_config(tmp_path):
11031121
"""Test that a dbt project can be loaded with an empty vars config."""
11041122
dbt_project_dir = tmp_path / "test_project"

0 commit comments

Comments
 (0)