From 6031b238afaf232a173b3ca5f672d8bd191b57ed Mon Sep 17 00:00:00 2001 From: Colin Rogers <111200756+colin-rogers-dbt@users.noreply.github.com> Date: Thu, 2 May 2024 14:29:25 -0700 Subject: [PATCH] Stop adding aliases to render_limited output (#782) * Stop adding aliases to render_limited output * add changie --- .changes/unreleased/Fixes-20240423-131503.yaml | 6 ++++++ dbt/adapters/redshift/relation.py | 1 + tests/functional/adapter/empty/test_empty.py | 6 +++++- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changes/unreleased/Fixes-20240423-131503.yaml diff --git a/.changes/unreleased/Fixes-20240423-131503.yaml b/.changes/unreleased/Fixes-20240423-131503.yaml new file mode 100644 index 000000000..8b5b82b38 --- /dev/null +++ b/.changes/unreleased/Fixes-20240423-131503.yaml @@ -0,0 +1,6 @@ +kind: Fixes +body: Stop adding aliases to subqueries when calling with `--empty` +time: 2024-04-23T13:15:03.118968-07:00 +custom: + Author: colin-rogers-dbt + Issue: "782" diff --git a/dbt/adapters/redshift/relation.py b/dbt/adapters/redshift/relation.py index e120a2fac..eaf60f54c 100644 --- a/dbt/adapters/redshift/relation.py +++ b/dbt/adapters/redshift/relation.py @@ -27,6 +27,7 @@ class RedshiftRelation(BaseRelation): include_policy = RedshiftIncludePolicy # type: ignore quote_policy = RedshiftQuotePolicy # type: ignore + require_alias: bool = False relation_configs = { RelationType.MaterializedView.value: RedshiftMaterializedViewConfig, } diff --git a/tests/functional/adapter/empty/test_empty.py b/tests/functional/adapter/empty/test_empty.py index 3368a90f9..27f36f1df 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 TestRedshiftEmpty(BaseTestEmpty): pass + + +class TestRedshiftEmptyInlineSourceRef(BaseTestEmptyInlineSourceRef): + pass