diff --git a/.changes/unreleased/Fixes-20240418-160240.yaml b/.changes/unreleased/Fixes-20240418-160240.yaml new file mode 100644 index 000000000..a9932def6 --- /dev/null +++ b/.changes/unreleased/Fixes-20240418-160240.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Fix duplicate alias being added when running a model with inline refs and `--empty` +time: 2024-04-18T16:02:40.488967-07:00 +custom: + Author: colin-rogers-dbt + Issue: "980" diff --git a/dbt/adapters/snowflake/relation.py b/dbt/adapters/snowflake/relation.py index ae037aebc..23952287c 100644 --- a/dbt/adapters/snowflake/relation.py +++ b/dbt/adapters/snowflake/relation.py @@ -20,7 +20,7 @@ class SnowflakeRelation(BaseRelation): type: Optional[SnowflakeRelationType] = None # type: ignore quote_policy: SnowflakeQuotePolicy = field(default_factory=lambda: SnowflakeQuotePolicy()) - + require_alias: bool = False renameable_relations: FrozenSet[SnowflakeRelationType] = field( default_factory=lambda: frozenset( { diff --git a/tests/functional/adapter/empty/test_empty.py b/tests/functional/adapter/empty/test_empty.py index 37aa45f60..401179b71 100644 --- a/tests/functional/adapter/empty/test_empty.py +++ b/tests/functional/adapter/empty/test_empty.py @@ -1,5 +1,9 @@ -from dbt.tests.adapter.empty.test_empty import BaseTestEmpty +from dbt.tests.adapter.empty.test_empty import BaseTestEmpty, BaseTestEmptyInlineSourceRef class TestSnowflakeEmpty(BaseTestEmpty): pass + + +class TestSnowflakeEmptyInlineSourceRef(BaseTestEmptyInlineSourceRef): + pass