diff --git a/misc/dbt-materialize/CHANGELOG.md b/misc/dbt-materialize/CHANGELOG.md index 1ec4645e4d22..8420cc0ca960 100644 --- a/misc/dbt-materialize/CHANGELOG.md +++ b/misc/dbt-materialize/CHANGELOG.md @@ -4,6 +4,7 @@ * Add support for overriding the `generate_cluster_name` macro to customize the cluster name generation logic in user projects. +* Stop adding aliases to subqueries when calling with `--empty` flag. ## 1.8.0 - 2024-05-23 diff --git a/misc/dbt-materialize/dbt/adapters/materialize/relation.py b/misc/dbt-materialize/dbt/adapters/materialize/relation.py index 6dd57e3bbb9b..2ace22cb914d 100644 --- a/misc/dbt-materialize/dbt/adapters/materialize/relation.py +++ b/misc/dbt-materialize/dbt/adapters/materialize/relation.py @@ -44,6 +44,7 @@ class MaterializeRelationType(StrEnum): @dataclass(frozen=True, eq=False, repr=False) class MaterializeRelation(PostgresRelation): type: Optional[MaterializeRelationType] = None + require_alias: bool = False # Materialize does not have a 63-character limit for relation names, unlike # PostgreSQL (see dbt-core #2727). Instead, we set 255 as the maximum diff --git a/misc/dbt-materialize/tests/adapter/test_empty.py b/misc/dbt-materialize/tests/adapter/test_empty.py index f2a80f0401ca..91dc5b3ed789 100644 --- a/misc/dbt-materialize/tests/adapter/test_empty.py +++ b/misc/dbt-materialize/tests/adapter/test_empty.py @@ -13,8 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from dbt.tests.adapter.empty.test_empty import BaseTestEmpty +from dbt.tests.adapter.empty.test_empty import ( + BaseTestEmpty, + BaseTestEmptyInlineSourceRef, +) class TestMaterializeEmpty(BaseTestEmpty): pass + + +class TestMaterializeEmptyInlineSourceRef(BaseTestEmptyInlineSourceRef): + pass