diff --git a/tests/integration/spend/test_daily_tag_spend_retention.py b/tests/integration/spend/test_daily_tag_spend_retention.py index b231819962c..5cbee96a2b1 100644 --- a/tests/integration/spend/test_daily_tag_spend_retention.py +++ b/tests/integration/spend/test_daily_tag_spend_retention.py @@ -14,7 +14,7 @@ from tests.integration._support.database import read_rows from tests.integration._support.process import owned_proxy CLEANUP_EVERY_MINUTE: Final = "* * * * *" -_CONFIG: Final = TypeAdapter(dict[str, dict[str, JsonValue]]) +_MAPPING: Final = TypeAdapter(dict[str, JsonValue]) def _day(days_ago: int) -> str: @@ -55,11 +55,11 @@ def _spend_log_present(request_id: str) -> bool: def _cleanup_config(tmp_path: Path, retention: dict[str, JsonValue]) -> Path: - base: Final = _CONFIG.validate_python(yaml.safe_load(Path("tests/integration/proxy_config.yaml").read_text())) + base: Final = _MAPPING.validate_python(yaml.safe_load(Path("tests/integration/proxy_config.yaml").read_text())) config: Final = { **base, "general_settings": { - **base["general_settings"], + **_MAPPING.validate_python(base["general_settings"]), **retention, "maximum_spend_logs_cleanup_cron": CLEANUP_EVERY_MINUTE, "scheduled_job_stagger": {"enabled": False}, diff --git a/tests/test_litellm/proxy/test_spend_log_cleanup.py b/tests/test_litellm/proxy/test_spend_log_cleanup.py index 612b24d7dd7..da78c96e8e3 100644 --- a/tests/test_litellm/proxy/test_spend_log_cleanup.py +++ b/tests/test_litellm/proxy/test_spend_log_cleanup.py @@ -835,7 +835,6 @@ async def test_daily_tag_spend_retention_alone_prunes_only_that_table_by_calenda tables = [call[0][0] for call in client.db.execute_raw.call_args_list] assert len(tables) == 1 assert '"LiteLLM_DailyTagSpend"' in tables[0] - assert '"date" < $1::text' in tables[0] cutoff_day = client.db.execute_raw.call_args[0][1] assert cutoff_day == (datetime.now(timezone.utc) - timedelta(days=90)).date().isoformat()