Skip to content

Commit 2b24996

Browse files
authored
Update invoke_churn_propensity_training_preparation.sqlx
1 parent d707e78 commit 2b24996

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

sql/query/invoke_churn_propensity_training_preparation.sqlx

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ SET churners = (SELECT COUNT(DISTINCT user_pseudo_id)
5757
);
5858

5959
-- Setting Training Dates
60-
-- If there are churners in the training set, then keep the user-defined dates, or else set
61-
-- the start and end dates instead.
60+
-- If there are churners in the training set, then keep the calculated dates, or else set
61+
-- the start and end dates to a fixed interval preventing `train_start_date` and `train_end_date` from being NULL.
6262
IF churners > 0 THEN
63-
SET train_start_date = GREATEST(train_start_date, min_date);
64-
SET train_end_date = LEAST(train_end_date, max_date);
65-
ELSE
6663
SET train_start_date = min_date;
6764
SET train_end_date = max_date;
65+
ELSE
66+
SET train_start_date = DATE '2000-01-01';
67+
SET train_end_date = DATE '2024-12-01';
6868
END IF;
6969

7070
-- Finally, the script calls a stored procedure, passing the adjusted training dates and split numbers as arguments.

0 commit comments

Comments
 (0)