Skip to content

Commit bdb78ff

Browse files
authored
skipping anomaly tests for clickhouse (#819)
1 parent 6207214 commit bdb78ff

12 files changed

+47
-5
lines changed

integration_tests/pytest.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[pytest]
2+
filterwarnings =
3+
ignore::DeprecationWarning:dbt.*
4+
ignore::DeprecationWarning:jinja2.*
5+
ignore::DeprecationWarning:click.*
6+
ignore::ResourceWarning

integration_tests/tests/test_all_columns_anomalies.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
}
1414

1515

16+
# Anomalies currently not supported on ClickHouse
17+
@pytest.mark.skip_targets(["clickhouse"])
1618
def test_anomalyless_all_columns_anomalies(test_id: str, dbt_project: DbtProject):
1719
utc_today = datetime.utcnow().date()
1820
data: List[Dict[str, Any]] = [
@@ -127,6 +129,8 @@ def test_all_columns_anomalies_with_where_expression(
127129
}
128130

129131

132+
# Anomalies currently not supported on ClickHouse
133+
@pytest.mark.skip_targets(["clickhouse"])
130134
def test_anomalyless_all_columns_anomalies_all_monitors_sanity(
131135
test_id: str, dbt_project: DbtProject
132136
):

integration_tests/tests/test_anomalies_backfill_logic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def get_latest_anomaly_test_metrics(dbt_project: DbtProject, test_id: str):
7474
}
7575

7676

77+
# Anomalies currently not supported on ClickHouse
78+
@pytest.mark.skip_targets(["clickhouse"])
7779
def test_full_backfill_for_non_incremental_model(dbt_project: DbtProject, test_id: str):
7880
utc_today = datetime.utcnow().date()
7981
data_dates = generate_dates(base_date=utc_today - timedelta(1))

integration_tests/tests/test_anomaly_exclude_metrics.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def test_exclude_specific_dates(
7171
assert test_result["status"] == "fail"
7272

7373

74+
# Anomalies currently not supported on ClickHouse
75+
@pytest.mark.skip_targets(["clickhouse"])
7476
def test_exclude_specific_timestamps(test_id: str, dbt_project: DbtProject):
7577
# To avoid races, set the "custom_started_at" to the beginning of the hour
7678
test_started_at = datetime.utcnow().replace(minute=0, second=0)

integration_tests/tests/test_anomaly_test_configuration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from dataclasses import dataclass
33
from typing import Generic, Literal, TypeVar
44

5+
import pytest
56
from dbt_project import DbtProject
67
from parametrization import Parametrization
78

@@ -112,6 +113,7 @@ def get_value(key: str):
112113
test_config={key: value.test for key, value in PARAM_VALUES.items()},
113114
expected_config=_get_expected_adapted_config("test"),
114115
)
116+
@pytest.mark.skip_targets(["clickhouse"])
115117
def test_anomaly_test_configuration(
116118
dbt_project: DbtProject,
117119
vars_config: dict,

integration_tests/tests/test_collect_metrics.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
}
3636

3737

38+
# Anomalies currently not supported on ClickHouse
39+
@pytest.mark.skip_targets(["clickhouse"])
3840
def test_collect_metrics(test_id: str, dbt_project: DbtProject):
3941
utc_today = datetime.utcnow().date()
4042
data: List[Dict[str, Any]] = [
@@ -63,6 +65,8 @@ def test_collect_metrics(test_id: str, dbt_project: DbtProject):
6365
assert col_to_metric_names == EXPECTED_COL_TO_METRIC_NAMES
6466

6567

68+
# Anomalies currently not supported on ClickHouse
69+
@pytest.mark.skip_targets(["clickhouse"])
6670
def test_collect_no_timestamp_metrics(test_id: str, dbt_project: DbtProject):
6771
utc_today = datetime.utcnow().date()
6872
data: List[Dict[str, Any]] = [
@@ -144,6 +148,8 @@ def test_collect_group_by_metrics(test_id: str, dbt_project: DbtProject):
144148
assert dim_to_col_to_metric_names == expected_dim_to_col_to_metric_names
145149

146150

151+
# Anomalies currently not supported on ClickHouse
152+
@pytest.mark.skip_targets(["clickhouse"])
147153
def test_collect_metrics_unique_metric_name(test_id: str, dbt_project: DbtProject):
148154
args = DBT_TEST_ARGS.copy()
149155
args["metrics"].append(args["metrics"][0])

integration_tests/tests/test_column_anomalies.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
}
1515

1616

17+
# Anomalies currently not supported on ClickHouse
18+
@pytest.mark.skip_targets(["clickhouse"])
1719
def test_anomalyless_column_anomalies(test_id: str, dbt_project: DbtProject):
1820
utc_today = datetime.utcnow().date()
1921
data: List[Dict[str, Any]] = [
@@ -137,6 +139,8 @@ def test_column_anomalies_with_where_parameter(test_id: str, dbt_project: DbtPro
137139
assert test_result["status"] == "fail"
138140

139141

142+
# Anomalies currently not supported on ClickHouse
143+
@pytest.mark.skip_targets(["clickhouse"])
140144
def test_column_anomalies_with_timestamp_as_sql_expression(
141145
test_id: str, dbt_project: DbtProject
142146
):
@@ -225,22 +229,20 @@ def test_volume_anomaly_static_data_drop(
225229
assert test_result["status"] == expected_result
226230

227231

232+
# Anomalies currently not supported on ClickHouse
233+
@pytest.mark.skip_targets(["clickhouse"])
228234
def test_anomalyless_column_anomalies_group(test_id: str, dbt_project: DbtProject):
229235
utc_today = datetime.utcnow().date()
230236
data: List[Dict[str, Any]] = [
231237
{
232238
TIMESTAMP_COLUMN: cur_date.strftime(DATE_FORMAT),
233239
"superhero": superhero,
234-
"dimension1": "dim1",
235-
"dimension2": "dim2",
236240
}
237241
for cur_date in generate_dates(base_date=utc_today - timedelta(1))
238242
for superhero in ["Superman", "Batman"]
239243
]
240-
test_args = DBT_TEST_ARGS.copy()
241-
test_args["dimensions"] = ["dimension1", "dimension2"]
242244
test_result = dbt_project.test(
243-
test_id, DBT_TEST_NAME, test_args, data=data, test_column="superhero"
245+
test_id, DBT_TEST_NAME, DBT_TEST_ARGS, data=data, test_column="superhero"
244246
)
245247
assert test_result["status"] == "pass"
246248

integration_tests/tests/test_dbt_artifacts/test_artifacts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,12 @@ def test_dbt_artifacts_hashes(dbt_project: DbtProject):
8383
dbt_project.read_table("dbt_artifacts_hashes", raise_if_empty=False)
8484

8585

86+
@pytest.mark.skip_targets(["clickhouse"])
8687
def test_anomaly_threshold_sensitivity(dbt_project: DbtProject):
8788
dbt_project.read_table("anomaly_threshold_sensitivity", raise_if_empty=False)
8889

8990

91+
@pytest.mark.skip_targets(["clickhouse"])
9092
def test_metrics_anomaly_score(dbt_project: DbtProject):
9193
dbt_project.read_table("metrics_anomaly_score", raise_if_empty=False)
9294

integration_tests/tests/test_dimension_anomalies.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def get_latest_anomaly_test_points(dbt_project: DbtProject, test_id: str):
3131
return [json.loads(result["result_row"]) for result in results]
3232

3333

34+
# Anomalies currently not supported on ClickHouse
35+
@pytest.mark.skip_targets(["clickhouse"])
3436
def test_anomalyless_dimension_anomalies(test_id: str, dbt_project: DbtProject):
3537
utc_today = datetime.utcnow().date()
3638
data: List[Dict[str, Any]] = [
@@ -49,6 +51,8 @@ def test_anomalyless_dimension_anomalies(test_id: str, dbt_project: DbtProject):
4951
assert len(anomaly_test_points) == 0
5052

5153

54+
# Anomalies currently not supported on ClickHouse
55+
@pytest.mark.skip_targets(["clickhouse"])
5256
def test_dimension_anomalies_with_timestamp_as_sql_expression(
5357
test_id: str, dbt_project: DbtProject
5458
):

integration_tests/tests/test_event_freshness_anomalies.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
STEP = timedelta(hours=1)
1111

1212

13+
# Anomalies currently not supported on ClickHouse
14+
@pytest.mark.skip_targets(["clickhouse"])
1315
def test_anomalyless_event_freshness(test_id: str, dbt_project: DbtProject):
1416
data = [
1517
{

0 commit comments

Comments
 (0)