-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Description `DatabricksSQLConnectionWrapper` should have `cancel` method and handle it properly. Otherwise, the following error will be seen when cancelling the session due to e.g., `dbt test --fail-fast`: ``` AttributeError: 'DatabricksSQLConnectionWrapper' object has no attribute 'cancel' ```
- Loading branch information
Showing
5 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: view_model | ||
columns: | ||
- name: id | ||
tests: | ||
- unique | ||
- not_null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
select 1 as id | ||
union all | ||
select 1 as id | ||
union all | ||
select null as id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from dbt.exceptions import FailFastException | ||
|
||
from tests.integration.base import DBTIntegrationTest, use_profile | ||
|
||
|
||
class TesFailFast(DBTIntegrationTest): | ||
@property | ||
def schema(self): | ||
return "fail_fast" | ||
|
||
@property | ||
def models(self): | ||
return "models" | ||
|
||
def test_fail_fast(self): | ||
self.run_dbt(["run"]) | ||
|
||
with self.assertRaisesRegex( | ||
FailFastException, "Failing early due to test failure or runtime error" | ||
): | ||
self.run_dbt(["test", "--fail-fast"]) | ||
|
||
@use_profile("databricks_cluster") | ||
def test_fail_fast_databricks_cluster(self): | ||
self.test_fail_fast() | ||
|
||
@use_profile("databricks_uc_cluster") | ||
def test_fail_fast_databricks_uc_cluster(self): | ||
self.test_fail_fast() | ||
|
||
@use_profile("databricks_sql_endpoint") | ||
def test_fail_fast_databricks_sql_endpoint(self): | ||
self.test_fail_fast() | ||
|
||
@use_profile("databricks_uc_sql_endpoint") | ||
def test_fail_fast_databricks_uc_sql_endpoint(self): | ||
self.test_fail_fast() |