SIENTIAPDE-1312

Update sientia-dataops-library dependency to version 1.4.7 and enhance TemporalManager to support offset configuration for scheduling. Added offset handling in common configuration and updated related tests to validate new functionality.
This commit is contained in:
vitor-aignosi
2025-10-20 10:26:53 -03:00
parent b693329f76
commit b095335cdc
5 changed files with 20 additions and 5 deletions

View File

@@ -209,7 +209,10 @@ class TemporalManager(BaseActivity):
ScheduleIntervalSpec(
every=timedelta(
seconds=parse_frequency(schedule.get('frequency', '1m'))
)
),
offset=timedelta(
seconds=parse_frequency(schedule.get('offset', '0m'))
),
)
]
),

View File

@@ -22,6 +22,7 @@ def common_config(config: dict[str, Any]):
'workflow_type': config['workflow_type'],
'schedule_name': config['schedule_name'],
'frequency': config.get('frequency', '1m'),
'offset': config.get('offset', '0m'),
'max_retry_policy': config.get('max_retry_policy', 1),
'model_id': config['model_id'],
'model_name': model['name'],

View File

@@ -5,5 +5,5 @@ redis
couchbase
pymongo
jinja2
git+ssh://git@github.com/Aignosi/sientia-dataops-library.git@1.4.6
git+ssh://git@github.com/Aignosi/sientia-dataops-library.git@1.4.7
prometheus-client

View File

@@ -148,6 +148,7 @@ async def test_create_schedule(
'model_name': 'test-model-name',
'workflow_type': 'test-workflow',
'frequency': '10y',
'offset': '5m',
'data': {'test': 'test'},
'execution_timeout_seconds': 400,
'task_timeout_seconds': 400,
@@ -159,6 +160,7 @@ async def test_create_schedule(
'model_name': 'test-model-name',
'workflow_type': 'test-workflow',
'frequency': '2m',
'offset': '1h',
'data': {'test': 'test'},
'execution_timeout_seconds': 500,
'task_timeout_seconds': 500,
@@ -239,10 +241,15 @@ async def test_create_schedule(
)
mock_schedule_interval_spec.assert_has_calls(
[call(every=timedelta(seconds=60)), call(every=timedelta(seconds=120))]
[
call(every=timedelta(seconds=60), offset=timedelta(seconds=0)),
call(every=timedelta(seconds=120), offset=timedelta(seconds=3600)),
]
)
mock_parse_frequency.assert_has_calls([call('1m'), call('10y'), call('2m')])
mock_parse_frequency.assert_has_calls(
[call('1m'), call('0m'), call('10y'), call('2m'), call('1h')]
)
mock_typed_search_attributes.assert_has_calls(
[

View File

@@ -24,6 +24,7 @@ def test_common_config():
'workflow_type': 'scouter',
'schedule_name': 'test_schedule',
'frequency': '1m',
'offset': '0m',
'max_retry_policy': 1,
'model_id': 'test_model_id',
'model_name': 'test_model_name',
@@ -48,6 +49,7 @@ def test_minimal_retrain():
'workflow_type': 'minimal_retrain',
'schedule_name': 'test_schedule',
'frequency': '1m',
'offset': '0m',
'max_retry_policy': 1,
'model_id': 'test_model_id',
'model_name': 'test_model_name',
@@ -81,6 +83,7 @@ def test_scouter():
'workflow_type': 'scouter',
'schedule_name': 'test_schedule',
'frequency': '1m',
'offset': '0m',
'max_retry_policy': 1,
'model_id': 'test_model_id',
'model_name': 'test_model_name',
@@ -163,6 +166,7 @@ def test_predictions_batch(mock_process_path_priority, mock_overlap_filter_confi
'workflow_type': 'predictions_batch',
'schedule_name': 'test_schedule',
'frequency': '1m',
'offset': '0m',
'max_retry_policy': 1,
'model_id': 'test_model_id',
'model_name': 'test_model_name',
@@ -275,7 +279,7 @@ def test_build_tag_config():
def test_build_tag_config_no_server_id():
tag = {'server_id': '1', 'tag_address': 'test_tag_address'}
opc_servers = {}
opc_servers: dict = {}
try:
build_tag_config(tag, {}, opc_servers, 1)