Skip to content

Commit

Permalink
Use variable to run singular test conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
amishas157 committed Sep 18, 2024
1 parent 27a99c5 commit e5460ef
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ vars:
exclude_packages: ["elementary"]

airflow_start_timestamp: "{{ env_var('AIRFLOW_START_TIMESTAMP', '2000-01-01') }}"
is_singular_airflow_task: "{{ env_var('IS_SINGULAR_AIRFLOW_TASK', 'false') }}"

# Configuring models
# Full documentation: https://docs.getdbt.com/docs/configuring-models
Expand Down
2 changes: 1 addition & 1 deletion tests/anomaly_detection_trade_count.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ config(
severity="warn"
, tags=["singular_test"]
, enabled = (target.name == "prod" and is_singular_airflow_task == "true")
, enabled = (target.name == "prod" and '{{ var("is_singular_airflow_task") }}' == "true")
)
}}

Expand Down
2 changes: 1 addition & 1 deletion tests/anomaly_detection_trade_volume.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ config(
severity="warn"
, tags=["singular_test"]
, enabled = (target.name == "prod" and is_singular_airflow_task == "true")
, enabled = (target.name == "prod" and '{{ var("is_singular_airflow_task") }}' == "true")
)
}}

Expand Down
2 changes: 1 addition & 1 deletion tests/bucketlist_db_size_check.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ config(
severity="error"
, tags=["singular_test"]
, enabled = (target.name == "prod" and is_singular_airflow_task == "true")
, enabled = (target.name == "prod" and '{{ var("is_singular_airflow_task") }}' == "true")
)
}}

Expand Down
2 changes: 1 addition & 1 deletion tests/eho_by_ops.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
severity="error"
, tags=["singular_test"]
, meta={"alert_suppression_interval": 24}
, enabled = (target.name == "prod" and is_singular_airflow_task == "true")
, enabled = (target.name == "prod" and '{{ var("is_singular_airflow_task") }}' == "true")
)
}}

Expand Down
2 changes: 1 addition & 1 deletion tests/ledger_sequence_increment.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ config(
severity="warn"
, tags=["singular_test"]
, enabled = (target.name == "prod" and is_singular_airflow_task == "true")
, enabled = ('{{ var("is_singular_airflow_task") }}' == "true")
)
}}

Expand Down
2 changes: 1 addition & 1 deletion tests/num_txns_and_ops.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ config(
severity="error"
, tags=["singular_test"]
, enabled = (target.name == "prod" and is_singular_airflow_task == "true")
, enabled = (target.name == "prod" and '{{ var("is_singular_airflow_task") }}' == "true")
)
}}

Expand Down
2 changes: 1 addition & 1 deletion tests/sorobon_surge_pricing_check.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
severity="warn"
, tags=["singular_test"]
, meta={"alert_suppression_interval": 24}
, enabled = (target.name == "prod" and is_singular_airflow_task == "true")
, enabled = (target.name == "prod" and '{{ var("is_singular_airflow_task") }}' == "true")
)
}}

Expand Down

0 comments on commit e5460ef

Please sign in to comment.