-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This work is basically in entirety a duplicate of the work done by MichelleArk in dbt-labs/dbt-snowflake#1179. I don't really expect this to work first try, but it might. I expect to need to do some edits, but who knows, maybe I'll get lucky.
- Loading branch information
Showing
3 changed files
with
56 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
24 changes: 24 additions & 0 deletions
24
tests/functional/adapter/incremental/test_incremental_microbatch.py
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,24 @@ | ||
import pytest | ||
from dbt.tests.adapter.incremental.test_incremental_microbatch import ( | ||
BaseMicrobatch, | ||
) | ||
|
||
|
||
# No requirement for a unique_id for redshift microbatch! | ||
_microbatch_model_no_unique_id_sql = """ | ||
{{ config(materialized='incremental', incremental_strategy='microbatch', event_time='event_time', batch_size='day') }} | ||
select * from {{ ref('input_model') }} | ||
""" | ||
|
||
|
||
class TestSnowflakeMicrobatch(BaseMicrobatch): | ||
@pytest.fixture(scope="class") | ||
def microbatch_model_sql(self) -> str: | ||
return _microbatch_model_no_unique_id_sql | ||
|
||
@pytest.fixture(scope="class") | ||
def insert_two_rows_sql(self, project) -> str: | ||
test_schema_relation = project.adapter.Relation.create( | ||
database=project.database, schema=project.test_schema | ||
) | ||
return f"insert into {test_schema_relation}.input_model (id, event_time) values (4, '2020-01-04 00:00:00-0'), (5, '2020-01-05 00:00:00-0')" |