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