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

Commit e5f9121

Browse files
authored
Merge pull request #382 from dlawin/addl_db_support
add redshift, postgres, databricks support
2 parents fbcb805 + dccdb1a commit e5f9121

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

data_diff/dbt.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def import_dbt():
3636
PROJECT_FILE = "/dbt_project.yml"
3737
PROFILES_FILE = "/profiles.yml"
3838
LOWER_DBT_V = "1.0.0"
39-
UPPER_DBT_V = "1.5.0"
39+
UPPER_DBT_V = "1.4.2"
4040

4141

4242
@dataclass
@@ -368,6 +368,35 @@ def set_connection(self):
368368
"project": rendered_credentials.get("project"),
369369
"dataset": rendered_credentials.get("dataset"),
370370
}
371+
elif conn_type == "redshift":
372+
if rendered_credentials.get("password") is None or rendered_credentials.get("method") == "iam":
373+
raise Exception("Only password authentication is currently supported for Redshift.")
374+
conn_info = {
375+
"driver": conn_type,
376+
"host": rendered_credentials.get("host"),
377+
"user": rendered_credentials.get("user"),
378+
"password": rendered_credentials.get("password"),
379+
"port": rendered_credentials.get("port"),
380+
"dbname": rendered_credentials.get("dbname"),
381+
}
382+
elif conn_type == "databricks":
383+
conn_info = {
384+
"driver": conn_type,
385+
"catalog": rendered_credentials.get("catalog"),
386+
"server_hostname": rendered_credentials.get("host"),
387+
"http_path": rendered_credentials.get("http_path"),
388+
"schema": rendered_credentials.get("schema"),
389+
"access_token": rendered_credentials.get("token"),
390+
}
391+
elif conn_type == "postgres":
392+
conn_info = {
393+
"driver": "postgresql",
394+
"host": rendered_credentials.get("host"),
395+
"user": rendered_credentials.get("user"),
396+
"password": rendered_credentials.get("password"),
397+
"port": rendered_credentials.get("port"),
398+
"dbname": rendered_credentials.get("dbname") or rendered_credentials.get("database"),
399+
}
371400
else:
372401
raise NotImplementedError(f"Provider {conn_type} is not yet supported for dbt diffs")
373402

0 commit comments

Comments
 (0)