Skip to content

Commit

Permalink
Add test case for when microbatch behavior flag is off
Browse files Browse the repository at this point in the history
  • Loading branch information
QMalcolm committed Oct 11, 2024
1 parent 16986be commit da65029
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def assert_row_count(self, project, relation_name: str, expected_row_count: int)

assert len(result) == expected_row_count, f"{relation_name}:{pformat(result)}"

class TestMicrobatchOn(BaseMicrobatch):
@pytest.fixture(scope="class")
def project_config_update(self):
return {
Expand Down Expand Up @@ -99,3 +100,19 @@ def test_run_with_event_time(self, project, insert_two_rows_sql):
with patch_microbatch_end_time("2020-01-05 14:57:00"):
run_dbt(["run", "--select", "microbatch_model"])
self.assert_row_count(project, "microbatch_model", 5)

class TestMicrobatchOff(BaseMicrobatch):
@pytest.fixture(scope="class")
def project_config_update(self):
return {
"flags": {
"require_builtin_microbatch_strategy": False,
}
}

def test_run_with_event_time(self, project):
with patch_microbatch_end_time("2020-01-03 13:57:00"):
result = run_dbt(["run"])
breakpoint()
self.assert_row_count(project, "microbatch_model", 3)

0 comments on commit da65029

Please sign in to comment.