-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-query statements: fix rows_affected + query comments (#153)
* Add test for rows_affected * Alt path for begin + commit. Query comments post-split * Fix unit test * Add changelog entry
- Loading branch information
Showing
4 changed files
with
65 additions
and
4 deletions.
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,22 @@ | ||
import pytest | ||
|
||
from dbt.tests.util import run_dbt | ||
from dbt.tests.adapter.basic.test_incremental import BaseIncremental | ||
|
||
class TestIncrementalRunResultSnowflake(BaseIncremental): | ||
"""Bonus test to verify that incremental models return the number of rows affected""" | ||
def test_incremental(self, project): | ||
# seed command | ||
results = run_dbt(["seed"]) | ||
assert len(results) == 2 | ||
|
||
# run with initial seed | ||
results = run_dbt(["run", "--vars", "seed_name: base"]) | ||
assert len(results) == 1 | ||
|
||
# run with additions | ||
results = run_dbt(["run", "--vars", "seed_name: added"]) | ||
assert len(results) == 1 | ||
# verify that run_result is correct | ||
rows_affected = results[0].adapter_response["rows_affected"] | ||
assert rows_affected == 10, f"Expected 10 rows changed, found {rows_affected}" |
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