File tree Expand file tree Collapse file tree 2 files changed +47
-3
lines changed
Expand file tree Collapse file tree 2 files changed +47
-3
lines changed Original file line number Diff line number Diff line change 55from pathlib import Path
66
77from dbt.adapters.base import BaseRelation, Column
8- from pydantic import Field
8+ from pydantic import Field, AliasChoices
99
1010from sqlmesh.core.console import get_console
1111from sqlmesh.core.config.connection import (
@@ -329,7 +329,7 @@ class PostgresConfig(TargetConfig):
329329 type: t.Literal["postgres"] = "postgres"
330330 host: str
331331 user: str
332- password: str
332+ password: str = Field(validation_alias=AliasChoices("pass", "password"))
333333 port: int
334334 dbname: str
335335 keepalives_idle: t.Optional[int] = None
@@ -417,7 +417,7 @@ class RedshiftConfig(TargetConfig):
417417 type: t.Literal["redshift"] = "redshift"
418418 host: str
419419 user: str
420- password: str
420+ password: str = Field(validation_alias=AliasChoices("pass", "password"))
421421 port: int
422422 dbname: str
423423 connect_timeout: t.Optional[int] = None
Original file line number Diff line number Diff line change @@ -650,6 +650,28 @@ def test_postgres_config():
650650 "outputs",
651651 "dev",
652652 )
653+ # 'pass' field instead of 'password'
654+ _test_warehouse_config(
655+ """
656+ dbt-postgres:
657+ target: dev
658+ outputs:
659+ dev:
660+ type: postgres
661+ host: postgres
662+ user: postgres
663+ pass: postgres
664+ port: 5432
665+ dbname: postgres
666+ schema: demo
667+ threads: 3
668+ keepalives_idle: 0
669+ """,
670+ PostgresConfig,
671+ "dbt-postgres",
672+ "outputs",
673+ "dev",
674+ )
653675
654676
655677def test_redshift_config():
@@ -674,6 +696,28 @@ def test_redshift_config():
674696 "outputs",
675697 "dev",
676698 )
699+ # 'pass' field instead of 'password'
700+ _test_warehouse_config(
701+ """
702+ dbt-redshift:
703+ target: dev
704+ outputs:
705+ dev:
706+ type: redshift
707+ host: hostname.region.redshift.amazonaws.com
708+ user: username
709+ pass: password1
710+ port: 5439
711+ dbname: analytics
712+ schema: analytics
713+ threads: 4
714+ ra3_node: false
715+ """,
716+ RedshiftConfig,
717+ "dbt-redshift",
718+ "outputs",
719+ "dev",
720+ )
677721
678722
679723def test_databricks_config():
You can’t perform that action at this time.
0 commit comments