From 74f7e6c024e1fd0123e43a6f3983419d758c9f9f Mon Sep 17 00:00:00 2001 From: vitor-aignosi Date: Tue, 16 Sep 2025 11:41:27 -0300 Subject: [PATCH] SIENTIAPDE-1222 Update prediction_store_policy handling in workflows - Added 'prediction_store_policy' to the input data handling in PredictionsBatch, ensuring a default value of 'lts:1' is used when not provided. - Modified FormatAndExportPrediction to directly use 'prediction_store_policy' from input_data, removing the default fallback. - Updated PredictionProcess to include 'prediction_store_policy' in the output data structure, ensuring consistency across workflows. --- laborious/workflows/predictions_batch.py | 4 +++- .../workflows/sub_workflows/format_and_export_prediction.py | 3 +-- laborious/workflows/sub_workflows/prediction_process.py | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/laborious/workflows/predictions_batch.py b/laborious/workflows/predictions_batch.py index ecce063..e522eaa 100644 --- a/laborious/workflows/predictions_batch.py +++ b/laborious/workflows/predictions_batch.py @@ -115,7 +115,9 @@ class PredictionsBatch(): }), 'model_config': input_data.get('model_config', {}), 'path_priority': input_data.get('path_priority', ['STOP', 'CONTINUE', 'REPEAT']), - 'opc_output_config': input_data.get('opc_output_config', {}) + 'opc_output_config': input_data.get('opc_output_config', {}), + 'prediction_store_policy': input_data.get( + 'prediction_store_policy', 'lts:1') } # Execute prediction process workflow diff --git a/laborious/workflows/sub_workflows/format_and_export_prediction.py b/laborious/workflows/sub_workflows/format_and_export_prediction.py index ae3ccfb..8e7df07 100644 --- a/laborious/workflows/sub_workflows/format_and_export_prediction.py +++ b/laborious/workflows/sub_workflows/format_and_export_prediction.py @@ -79,8 +79,7 @@ class FormatAndExportPrediction(): 'timestamp': input_data['timestamp'], 'model_id': input_data['model_id'], 'prediction_confidence': prediction_confidence, - 'prediction_store_policy': input_data.get( - 'prediction_store_policy', 'lts:1') + 'prediction_store_policy': input_data['prediction_store_policy'] }, retry_policy=retry_policy, start_to_close_timeout=timedelta(seconds=60) diff --git a/laborious/workflows/sub_workflows/prediction_process.py b/laborious/workflows/sub_workflows/prediction_process.py index c958500..777fa1c 100644 --- a/laborious/workflows/sub_workflows/prediction_process.py +++ b/laborious/workflows/sub_workflows/prediction_process.py @@ -213,7 +213,8 @@ class PredictionProcess(): 'opc_output_config': input_data['opc_output_config'], 'schema': input_data['schema'], 'table_name': input_data['table_name'], - 'comment': comment + 'comment': comment, + 'prediction_store_policy': input_data['prediction_store_policy'] } ) @@ -286,7 +287,8 @@ class PredictionProcess(): 'schema': schema, 'table_name': table_name, 'comment': comment, - 'opc_output_config': input_data['opc_output_config'] + 'opc_output_config': input_data['opc_output_config'], + 'prediction_store_policy': input_data['prediction_store_policy'] } ) return True