feat: update training workflow and repository management
- Replaced synchronous MinIO repository calls with asynchronous counterparts in the Training class for improved performance. - Enhanced logging throughout the training process to provide better insights into model metadata loading, parameter validation, and training execution. - Updated the train_test_split function to enforce DataFrame input type, ensuring consistency in data handling. - Removed the deprecated model_repository.py file to streamline the codebase. - Adjusted cleanup schedule logic to improve error handling and logging during schedule reconciliation. - Updated tests to reflect changes in the training workflow and repository interactions.
This commit is contained in:
@@ -125,6 +125,29 @@ async def test_schedule_exists_handles_exception(mock_temporal_client, mock_logg
|
||||
assert 'Error checking if schedule exists' in mock_logger.custom_error.call_args[0][0]
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_needs_schedule_reconcile_handles_describe_exception(mock_logger, metadata):
|
||||
"""Test _needs_schedule_reconcile returns True and logs when describe fails."""
|
||||
from model_manager.schedules.cleanup_schedule import _needs_schedule_reconcile
|
||||
|
||||
handle = AsyncMock()
|
||||
handle.describe = AsyncMock(side_effect=RuntimeError('describe failed'))
|
||||
|
||||
needs_reconcile = await _needs_schedule_reconcile(
|
||||
schedule_handle=handle,
|
||||
cleanup_task_queue='cleanup_files-model-manager-worker-queue',
|
||||
logger=mock_logger,
|
||||
metadata=metadata,
|
||||
)
|
||||
|
||||
assert needs_reconcile is True
|
||||
mock_logger.custom_error.assert_called_once()
|
||||
assert (
|
||||
'Error describing cleanup schedule for reconcile'
|
||||
in mock_logger.custom_error.call_args[0][0]
|
||||
)
|
||||
|
||||
|
||||
# --- create_cleanup_schedule Tests ---
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user