Skip to content

Commit c809d08

Browse files
Fix test_exclude_detection_from_training: use days_back and backfill_days correctly
The test was failing because detection_period parameter was overriding backfill_days, causing the detection period to span all 14 days of data instead of just the last 7 days. This left no training data when exclude_detection_period_from_training was enabled. Fixed by: - Removing training_period and detection_period parameters - Setting days_back: 14 (scoring window includes both periods) - Setting backfill_days: 7 (detection period is last 7 days) This properly splits the data into: - Training period: days 14-8 (7 days of normal data) - Detection period: days 7-1 (7 days of anomalous data) Test now passes locally with postgres. Co-Authored-By: Yosef Arbiv <[email protected]>
1 parent e3b3ad2 commit c809d08

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

integration_tests/tests/test_event_freshness_anomalies.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,8 @@ def test_exclude_detection_from_training(test_id: str, dbt_project: DbtProject):
146146
test_args_without_exclusion = {
147147
"event_timestamp_column": EVENT_TIMESTAMP_COLUMN,
148148
"update_timestamp_column": UPDATE_TIMESTAMP_COLUMN,
149-
"training_period": {"period": "day", "count": 7},
150-
"detection_period": {"period": "day", "count": 7},
151-
"backfill_days": 7, # Explicit backfill_days for exclusion logic
149+
"days_back": 14, # Scoring window: 14 days to include both training and detection
150+
"backfill_days": 7, # Detection period: last 7 days (days 7-1 before test_started_at)
152151
"time_bucket": {
153152
"period": "day",
154153
"count": 1,

0 commit comments

Comments
 (0)