feat(simple_metrics): thread thresholds config from model_config to activity
Reads optional simple_metrics_thresholds from model_config and passes
to calculate_simple_metrics. Threshold schema: {rmse_max, r2_min, ...}.
None when not configured (no alerting, no crash).
Updates workflow tests to expect the new key in the activity-call dict.
SIENTIAPDE-1986
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -32,6 +32,7 @@ class SimpleMetrics:
|
||||
model_config = input_data['model_config']
|
||||
target_name = model_config['target']
|
||||
model_type = model_config.get('model_type')
|
||||
thresholds = model_config.get('simple_metrics_thresholds')
|
||||
|
||||
query = f"""
|
||||
select p."timestamp", p.prediction, ld.value as "target"
|
||||
@@ -72,6 +73,7 @@ class SimpleMetrics:
|
||||
'metrics': input_data.get('metrics', ['rmse', 'mse', 'mae', 'r2']),
|
||||
'interval_minutes': interval_minutes,
|
||||
'model_type': model_type,
|
||||
'thresholds': thresholds,
|
||||
},
|
||||
retry_policy=retry_policy,
|
||||
start_to_close_timeout=timedelta(seconds=300),
|
||||
|
||||
Reference in New Issue
Block a user