From 6f3c9de5fbdf85316707c167b9310088f50383a0 Mon Sep 17 00:00:00 2001 From: Axell Padilla <68310020+axellpadilla@users.noreply.github.com> Date: Sat, 28 Sep 2024 05:49:45 +0000 Subject: [PATCH] fix to make drop_schema_name usable and test pass --- dbt/include/sqlserver/macros/adapter/schemas.sql | 2 +- tests/functional/adapter/dbt/test_relations.py | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/dbt/include/sqlserver/macros/adapter/schemas.sql b/dbt/include/sqlserver/macros/adapter/schemas.sql index 8317d6cb..ba6a83e2 100644 --- a/dbt/include/sqlserver/macros/adapter/schemas.sql +++ b/dbt/include/sqlserver/macros/adapter/schemas.sql @@ -1,5 +1,5 @@ {% macro sqlserver__drop_schema_named(schema_name) %} - {% set schema_relation = api.Relation.create(schema=schema_name) %} + {% set schema_relation = api.Relation.create(schema=schema_name, database=target.database) %} {{ adapter.drop_schema(schema_relation) }} {% endmacro %} diff --git a/tests/functional/adapter/dbt/test_relations.py b/tests/functional/adapter/dbt/test_relations.py index 45ebe161..33ade302 100644 --- a/tests/functional/adapter/dbt/test_relations.py +++ b/tests/functional/adapter/dbt/test_relations.py @@ -1,4 +1,3 @@ -import pytest from dbt.tests.adapter.relations.test_changing_relation_type import BaseChangeRelationTypeValidator from dbt.tests.adapter.relations.test_dropping_schema_named import BaseDropSchemaNamed @@ -7,12 +6,5 @@ class TestChangeRelationTypeValidator(BaseChangeRelationTypeValidator): pass -@pytest.mark.xfail( - reason=""" - Test fails as its not passing Use[] properly. - `Use[None]` is called, should be `User[TestDB]` - Unclear why the macro doens't pass it properly. - """ -) class TestDropSchemaNamed(BaseDropSchemaNamed): pass