Skip to content

Commit e7d908b

Browse files
committed
Corrected type errors and drop errors in tests
1 parent 94175f0 commit e7d908b

File tree

2 files changed

+54
-2
lines changed

2 files changed

+54
-2
lines changed

dbt/adapters/sqlserver/sqlserver_credentials.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from dataclasses import dataclass
2+
from typing import Optional
23

34
from dbt.adapters.fabric import FabricCredentials
45

@@ -10,8 +11,8 @@ class SQLServerCredentials(FabricCredentials):
1011
profiles.yml to connect to new adapter
1112
"""
1213

13-
port: int | None = 1433
14-
authentication: str | None = "sql"
14+
port: Optional[int] = 1433
15+
authentication: Optional[str] = "sql"
1516

1617
@property
1718
def type(self):

tests/functional/adapter/dbt/test_simple_seed.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,23 @@ def setUp(self, project):
137137

138138

139139
class TestSimpleSeedEnabledViaConfig__seed_with_disabled(BaseSimpleSeedEnabledViaConfig):
140+
@pytest.fixture(scope="function")
141+
def clear_test_schema(self, project):
142+
yield
143+
project.run_sql(
144+
f"drop table if exists {project.database}.{project.test_schema}.seed_enabled"
145+
)
146+
project.run_sql(
147+
f"drop table if exists {project.database}.{project.test_schema}.seed_disabled"
148+
)
149+
project.run_sql(
150+
f"drop table if exists {project.database}.{project.test_schema}.seed_tricky"
151+
)
152+
project.run_sql(f"drop view if exists {project.test_schema}.seed_enabled")
153+
project.run_sql(f"drop view if exists {project.test_schema}.seed_disabled")
154+
project.run_sql(f"drop view if exists {project.test_schema}.seed_tricky")
155+
project.run_sql(f"drop schema if exists {project.test_schema}")
156+
140157
def test_simple_seed_with_disabled(self, clear_test_schema, project):
141158
results = run_dbt(["seed"])
142159
assert len(results) == 2
@@ -172,6 +189,23 @@ def test_simple_seed_exclude(self, clear_test_schema, project):
172189

173190

174191
class TestSimpleSeedEnabledViaConfig__seed_selection(BaseSimpleSeedEnabledViaConfig):
192+
@pytest.fixture(scope="function")
193+
def clear_test_schema(self, project):
194+
yield
195+
project.run_sql(
196+
f"drop table if exists {project.database}.{project.test_schema}.seed_enabled"
197+
)
198+
project.run_sql(
199+
f"drop table if exists {project.database}.{project.test_schema}.seed_disabled"
200+
)
201+
project.run_sql(
202+
f"drop table if exists {project.database}.{project.test_schema}.seed_tricky"
203+
)
204+
project.run_sql(f"drop view if exists {project.test_schema}.seed_enabled")
205+
project.run_sql(f"drop view if exists {project.test_schema}.seed_disabled")
206+
project.run_sql(f"drop view if exists {project.test_schema}.seed_tricky")
207+
project.run_sql(f"drop schema if exists {project.test_schema}")
208+
175209
@pytest.mark.skip(
176210
reason="""
177211
Running all the tests in the same schema causes the tests to fail
@@ -207,6 +241,23 @@ def test_simple_seed_exclude(self, clear_test_schema, project):
207241

208242

209243
class TestSimpleSeedEnabledViaConfig__seed_exclude(BaseSimpleSeedEnabledViaConfig):
244+
@pytest.fixture(scope="function")
245+
def clear_test_schema(self, project):
246+
yield
247+
project.run_sql(
248+
f"drop table if exists {project.database}.{project.test_schema}.seed_enabled"
249+
)
250+
project.run_sql(
251+
f"drop table if exists {project.database}.{project.test_schema}.seed_disabled"
252+
)
253+
project.run_sql(
254+
f"drop table if exists {project.database}.{project.test_schema}.seed_tricky"
255+
)
256+
project.run_sql(f"drop view if exists {project.test_schema}.seed_enabled")
257+
project.run_sql(f"drop view if exists {project.test_schema}.seed_disabled")
258+
project.run_sql(f"drop view if exists {project.test_schema}.seed_tricky")
259+
project.run_sql(f"drop schema if exists {project.test_schema}")
260+
210261
@pytest.mark.skip(
211262
reason="""
212263
Running all the tests in the same schema causes the tests to fail

0 commit comments

Comments
 (0)