mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
fix(batches): persist real terminal status when billing expired batches
This commit is contained in:
parent
19184694f5
commit
eacea13a25
2 changed files with 4 additions and 1 deletions
|
|
@ -698,7 +698,7 @@ class CheckBatchCost:
|
|||
# mark the job as complete
|
||||
try:
|
||||
update_data: dict = {
|
||||
"status": "complete",
|
||||
"status": response.status if response.status != "completed" else "complete",
|
||||
"file_object": response.model_dump_json(),
|
||||
}
|
||||
if self._has_batch_processed_column:
|
||||
|
|
|
|||
|
|
@ -1036,6 +1036,9 @@ class TestCheckBatchCost:
|
|||
1
|
||||
]["data"]
|
||||
assert update_data["batch_processed"] is True
|
||||
assert (
|
||||
update_data["status"] == "expired"
|
||||
), "billed expired batch must keep its real terminal status in the DB"
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_raw_output_file_id_converted_to_managed_id(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue