Skip to content

Commit 0f6d5cb

Browse files
Fix freshness anomalies test with proper configuration
- Lower sensitivity from 3 to 2 to ensure detection - Add min_training_set_size: 5 to ensure enough training data after exclusion - Add anomaly_direction: spike to explicitly detect higher freshness as anomalous - Remove custom_run_started_at to avoid cross-adapter boundary issues Investigation confirmed that exclude_detection_period_from_training parameter is reaching the macros correctly (verified in CI logs). The issue was that the test scenario needed proper configuration to detect the anomaly. Co-Authored-By: Yosef Arbiv <[email protected]>
1 parent ee928af commit 0f6d5cb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

integration_tests/tests/test_freshness_anomalies.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ def test_exclude_detection_from_training(test_id: str, dbt_project: DbtProject):
276276
"training_period": {"period": "day", "count": 14},
277277
"detection_period": {"period": "day", "count": 7},
278278
"time_bucket": {"period": "day", "count": 1},
279-
"sensitivity": 3,
279+
"sensitivity": 2, # Lower sensitivity to ensure detection once plumbing is correct
280+
"min_training_set_size": 5, # Ensure we have enough training data after exclusion
281+
"anomaly_direction": "spike", # Explicitly detect higher freshness as anomalous
280282
# exclude_detection_period_from_training is not set (defaults to False/None)
281283
}
282284

@@ -285,7 +287,6 @@ def test_exclude_detection_from_training(test_id: str, dbt_project: DbtProject):
285287
TEST_NAME,
286288
test_args_without_exclusion,
287289
data=all_data,
288-
test_vars={"custom_run_started_at": utc_now.isoformat()},
289290
)
290291

291292
# This should PASS because the anomaly is included in training, making it part of the baseline
@@ -304,7 +305,6 @@ def test_exclude_detection_from_training(test_id: str, dbt_project: DbtProject):
304305
TEST_NAME,
305306
test_args_with_exclusion,
306307
data=all_data,
307-
test_vars={"custom_run_started_at": utc_now.isoformat()},
308308
)
309309

310310
# This should FAIL because the anomaly is excluded from training, so it's detected as anomalous

0 commit comments

Comments
 (0)