From 7107902d29f50782a25f930cbde6137c0917563d Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Mon, 23 Mar 2026 13:03:10 +0530 Subject: [PATCH] feat(fine-tuning): address greptile review feedback (greploop iteration 5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove unused FineTuningJob import from test - Document "canceling" → "cancelled" mapping in _AZURE_STATUS_MAP Made-with: Cursor --- litellm/llms/openai/fine_tuning/handler.py | 2 ++ tests/batches_tests/test_fine_tuning_api.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/litellm/llms/openai/fine_tuning/handler.py b/litellm/llms/openai/fine_tuning/handler.py index 6800fe81d65..c065325254e 100644 --- a/litellm/llms/openai/fine_tuning/handler.py +++ b/litellm/llms/openai/fine_tuning/handler.py @@ -15,6 +15,8 @@ _AZURE_STATUS_MAP = { "canceled": "cancelled", "canceling": "cancelled", } +# Note: Azure's "canceling" (in-progress) is mapped to "cancelled" (terminal) +# because LiteLLMFineTuningJob schema has no intermediate cancellation state. def _normalize_fine_tuning_job_dict( diff --git a/tests/batches_tests/test_fine_tuning_api.py b/tests/batches_tests/test_fine_tuning_api.py index 3ab15306fcb..7e220612ac6 100644 --- a/tests/batches_tests/test_fine_tuning_api.py +++ b/tests/batches_tests/test_fine_tuning_api.py @@ -616,7 +616,6 @@ async def test_mock_openai_retrieve_fine_tune_job(): @pytest.mark.asyncio async def test_mock_azure_create_fine_tune_job_with_azure_specific_params(): """Test that Azure-specific parameters are passed through extra_body""" - from openai.types.fine_tuning.fine_tuning_job import FineTuningJob from openai.types.fine_tuning.fine_tuning_job import Hyperparameters as OAIHyperparameters from litellm.types.utils import LiteLLMFineTuningJob