Skip to content

Commit 2d4cfb6

Browse files
committed
Fix tests
1 parent c1f673a commit 2d4cfb6

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

dbt-spark/src/dbt/adapters/spark/relation.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from dbt.adapters.base.relation import BaseRelation, Policy
55
from dbt.adapters.events.logging import AdapterLogger
66

7-
from dbt_common.exceptions import DbtRuntimeError
8-
97
logger = AdapterLogger("Spark")
108

119
Self = TypeVar("Self", bound="BaseRelation")

dbt-spark/tests/unit/test_adapter.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,15 @@ def test_parse_relation_with_statistics(self):
391391

392392
def test_relation_with_database(self):
393393
adapter = SparkAdapter(self.target_http, get_context("spawn"))
394-
# fine
395-
adapter.Relation.create(schema="different", identifier="table")
396-
with self.assertRaises(DbtRuntimeError):
397-
# not fine - database set
398-
adapter.Relation.create(database="something", schema="different", identifier="table")
394+
# two-part name: schema.identifier
395+
relation = adapter.Relation.create(schema="different", identifier="table")
396+
assert relation.render() == "different.table"
397+
398+
# three-part name: database.schema.identifier
399+
relation = adapter.Relation.create(
400+
database="catalog", schema="different", identifier="table"
401+
)
402+
assert relation.render() == "catalog.different.table"
399403

400404
def test_profile_with_database(self):
401405
profile = {

0 commit comments

Comments
 (0)