File tree Expand file tree Collapse file tree 2 files changed +15
-10
lines changed
Expand file tree Collapse file tree 2 files changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -601,12 +601,17 @@ def validate_fields(cls, data: t.Any) -> t.Any:
601601 if not isinstance (data , dict ):
602602 return data
603603
604- data ["schema" ] = data .get ("schema" ) or data .get ("dataset" )
605- if not data ["schema" ]:
604+ # dbt treats schema and dataset interchangeably
605+ schema = data .get ("schema" ) or data .get ("dataset" )
606+ if not schema :
606607 raise ConfigError ("Either schema or dataset must be set" )
607- data ["database" ] = data .get ("database" ) or data .get ("project" )
608- if not data ["database" ]:
608+ data ["dataset" ] = data ["schema" ] = schema
609+
610+ # dbt treats database and project interchangeably
611+ database = data .get ("database" ) or data .get ("project" )
612+ if not database :
609613 raise ConfigError ("Either database or project must be set" )
614+ data ["database" ] = data ["project" ] = database
610615
611616 return data
612617
Original file line number Diff line number Diff line change @@ -1192,13 +1192,13 @@ def test_target_jinja(sushi_test_project: Project):
11921192 context = DbtContext ()
11931193 context ._target = BigQueryConfig (
11941194 name = "target" ,
1195- schema = "test" ,
1196- database = "test" ,
1197- project = "project" ,
1198- dataset = "dataset" ,
1195+ schema = "test_value" ,
1196+ database = "test_project" ,
11991197 )
1200- assert context .render ("{{ target.project }}" ) == "project"
1201- assert context .render ("{{ target.dataset }}" ) == "dataset"
1198+ assert context .render ("{{ target.project }}" ) == "test_project"
1199+ assert context .render ("{{ target.database }}" ) == "test_project"
1200+ assert context .render ("{{ target.schema }}" ) == "test_value"
1201+ assert context .render ("{{ target.dataset }}" ) == "test_value"
12021202
12031203
12041204@pytest .mark .xdist_group ("dbt_manifest" )
You can’t perform that action at this time.
0 commit comments