Skip to content

Commit b6aac49

Browse files
committed
test fixes
1 parent bbd163d commit b6aac49

1 file changed

Lines changed: 22 additions & 9 deletions

File tree

integration_tests/tests/test_dbt_artifacts/test_microbatch_compiled_code.py

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
1+
import pytest
2+
13
from dbt_project import DbtProject
24

35

6+
@pytest.mark.skip_targets(["vertica"])
7+
@pytest.mark.skip_for_dbt_fusion
48
def test_microbatch_run_results_has_compiled_code(test_id: str, dbt_project: DbtProject):
59
dbt_project.dbt_runner.vars["disable_run_results"] = False
610

711
model_sql = """
8-
{{ config(
9-
materialized='incremental',
10-
incremental_strategy='microbatch',
11-
event_time='order_date',
12-
batch_size='year',
13-
begin='2025-03-01',
14-
unique_key='order_id'
15-
) }}
12+
{% set model_config = {
13+
"materialized": "incremental",
14+
"incremental_strategy": "microbatch",
15+
"event_time": "order_date",
16+
"batch_size": "year",
17+
"begin": "2025-03-01",
18+
"unique_key": "order_id"
19+
} %}
20+
{% if target.type == "bigquery" %}
21+
{% do model_config.update(
22+
{"partition_by": {"field": "order_date", "data_type": "timestamp", "granularity": "year"}}
23+
) %}
24+
{% endif %}
25+
{% if target.type == "athena" %}
26+
{% do model_config.update({"partitioned_by": ["order_date"]}) %}
27+
{% endif %}
28+
{{ config(**model_config) }}
1629
1730
select
18-
cast(one as int) as order_id,
31+
cast({{ elementary.escape_reserved_keywords("one") }} as int) as order_id,
1932
1 as customer_id,
2033
42 as amount,
2134
{{ dbt.current_timestamp() }} as order_date

0 commit comments

Comments
 (0)