From 2f06036d0e6ef1db5fbc7b4ce3a853ddd96d38ca Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Mon, 17 Nov 2025 12:57:17 -0300 Subject: [PATCH] SIENTIAPDE-1273 SIENTIAPDE-1273 Refactor drift function in orchestrator utilities for improved configuration and update formatters to include drift import. Enhance tests to validate new configurations and ensure integration with existing workflows. --- orchestrator/activities/formatters.py | 2 +- orchestrator/utils/orchestrator_functions.py | 8 +++----- tests/orchestrator/utils/test_orchestrator_functions.py | 1 + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/orchestrator/activities/formatters.py b/orchestrator/activities/formatters.py index b09df5b..6123ad2 100644 --- a/orchestrator/activities/formatters.py +++ b/orchestrator/activities/formatters.py @@ -15,11 +15,11 @@ with workflow.unsafe.imports_passed_through(): from orchestrator.utils.orchestrator_functions import ( build_tag_config, + drift, gather_read_tags, minimal_retrain, predictions_batch, scouter, - drift, simple_metrics, ) diff --git a/orchestrator/utils/orchestrator_functions.py b/orchestrator/utils/orchestrator_functions.py index d3f4a06..3aec5dd 100644 --- a/orchestrator/utils/orchestrator_functions.py +++ b/orchestrator/utils/orchestrator_functions.py @@ -42,11 +42,9 @@ def drift(config: dict[str, Any]): 'source_table_name': 'laborious_data', 'target_table_name': 'drift_metrics', 'interval': config.get('interval_minutes', 60), - 'drift_metrics': config.get('drift_metrics', [ - "kolmogorov_smirnov", - "jensen_shannon", - "wasserstein" - ]) + 'drift_metrics': config.get( + 'drift_metrics', ['kolmogorov_smirnov', 'jensen_shannon', 'wasserstein'] + ), } diff --git a/tests/orchestrator/utils/test_orchestrator_functions.py b/tests/orchestrator/utils/test_orchestrator_functions.py index de0eddd..4dc9666 100644 --- a/tests/orchestrator/utils/test_orchestrator_functions.py +++ b/tests/orchestrator/utils/test_orchestrator_functions.py @@ -89,6 +89,7 @@ def test_simple_metrics(): 'schema': 'sientia_data', 'predictions_table_name': 'predictions', 'data_table_name': 'laborious_data', + 'target_table_name': 'simple_metrics', 'interval_minutes': 120, 'metrics': ['rmse', 'mse'], 'execution_timeout_seconds': 300,