diff --git a/.changes/unreleased/Fixes-20240506-130645.yaml b/.changes/unreleased/Fixes-20240506-130645.yaml new file mode 100644 index 00000000..973595f1 --- /dev/null +++ b/.changes/unreleased/Fixes-20240506-130645.yaml @@ -0,0 +1,7 @@ +kind: Fixes +body: Stop adding aliases to subqueries when calling with `--empty` +time: 2024-05-06T13:06:45.642583+02:00 +custom: + Author: damian3031 + Issue: "" + PR: "408" diff --git a/dbt/adapters/trino/relation.py b/dbt/adapters/trino/relation.py index a6eea946..0b9a83ee 100644 --- a/dbt/adapters/trino/relation.py +++ b/dbt/adapters/trino/relation.py @@ -7,6 +7,7 @@ @dataclass(frozen=True, eq=False, repr=False) class TrinoRelation(BaseRelation): quote_policy: Policy = field(default_factory=lambda: Policy()) + require_alias: bool = False # Overridden as Trino converts relation identifiers to lowercase def _is_exactish_match(self, field: ComponentName, value: str) -> bool: diff --git a/tests/functional/adapter/empty/test_empty.py b/tests/functional/adapter/empty/test_empty.py index d76a83d5..c112c370 100644 --- a/tests/functional/adapter/empty/test_empty.py +++ b/tests/functional/adapter/empty/test_empty.py @@ -1,5 +1,12 @@ -from dbt.tests.adapter.empty.test_empty import BaseTestEmpty +from dbt.tests.adapter.empty.test_empty import ( + BaseTestEmpty, + BaseTestEmptyInlineSourceRef, +) class TestTrinoEmpty(BaseTestEmpty): pass + + +class TestTrinoEmptyInlineSourceRef(BaseTestEmptyInlineSourceRef): + pass