refactor(s3_v2): read cold storage metadata without an empty dict default
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
yucheng 2026-10-01 00:42:33 +00:00
parent e999a4e0b6
commit fc6060e118

View file

@ -840,9 +840,10 @@ class S3Logger(CustomBatchLogger, BaseAWSLLM):
partition_granularity=partition_granularity,
)
metadata: Final = standard_logging_payload.get("metadata")
cold_storage_object_key: Final = (
standard_logging_payload.get("metadata", {}).get("cold_storage_object_key")
if litellm.cold_storage_custom_logger == "s3_v2"
metadata.get("cold_storage_object_key")
if metadata is not None and litellm.cold_storage_custom_logger == "s3_v2"
else None
)
s3_object_key: Final = (