diff --git a/CHANGELOG.md b/CHANGELOG.md index c871fd94294..523b8f309d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Added --fail-fast argument for dbt run and dbt test to fail on first test failure or runtime error. ([#1649](https://github.com/fishtown-analytics/dbt/issues/1649), [#2224](https://github.com/fishtown-analytics/dbt/pull/2224)) - Support for appending query comments to SQL queries. ([#2138](https://github.com/fishtown-analytics/dbt/issues/2138), [#2199](https://github.com/fishtown-analytics/dbt/pull/2199)) - Added a `get-manifest` API call. ([#2168](https://github.com/fishtown-analytics/dbt/issues/2168), [#2232](https://github.com/fishtown-analytics/dbt/pull/2232)) +- Support adapter-specific aliases (like `project` and `dataset` on BigQuery) in source definitions. ([#2133](https://github.com/fishtown-analytics/dbt/issues/2133), [#2244](https://github.com/fishtown-analytics/dbt/pull/2244)) - Users can now use jinja as arguments to tests. Test arguments are rendered in the native context and injected into the test execution context directly. ([#2149](https://github.com/fishtown-analytics/dbt/issues/2149), [#2220](https://github.com/fishtown-analytics/dbt/pull/2220)) ### Fixes diff --git a/core/dbt/parser/schemas.py b/core/dbt/parser/schemas.py index 5df601cbd7d..7538c02b025 100644 --- a/core/dbt/parser/schemas.py +++ b/core/dbt/parser/schemas.py @@ -530,6 +530,7 @@ def get_unparsed_target(self) -> Iterable[SourceTarget]: for data in self.get_key_dicts(): try: + data = self.project.credentials.translate_aliases(data) data = self._renderer.render_schema_source(data) source = UnparsedSourceDefinition.from_dict(data) except (ValidationError, JSONValidationException) as exc: diff --git a/test/integration/022_bigquery_test/models/schema.yml b/test/integration/022_bigquery_test/models/schema.yml index 031753900d4..68625ffc68d 100644 --- a/test/integration/022_bigquery_test/models/schema.yml +++ b/test/integration/022_bigquery_test/models/schema.yml @@ -49,3 +49,12 @@ models: - was_materialized: name: fUnKyCaSe type: view + + +sources: + - name: raw + project: "{{ target.database }}" + dataset: "{{ target.schema }}" + tables: + - name: seed + identifier: data_seed diff --git a/test/integration/022_bigquery_test/models/view_model.sql b/test/integration/022_bigquery_test/models/view_model.sql index dd926ba11e0..bacdaf874ea 100644 --- a/test/integration/022_bigquery_test/models/view_model.sql +++ b/test/integration/022_bigquery_test/models/view_model.sql @@ -11,4 +11,4 @@ select current_date as updated_at, dupe -from {{ ref('data_seed') }} +from {{ source('raw', 'seed') }}