mirror of
https://github.com/beshu-tech/deltaglider.git
synced 2026-09-02 08:37:18 +02:00
fix(types): narrow metadata value to str in _first_metadata_value
Newer boto3-stubs (>=1.40 floor) types Object metadata values as Any, tripping mypy no-any-return. Narrow with isinstance(value, str).
This commit is contained in:
@@ -40,7 +40,7 @@ def _first_metadata_value(metadata: dict[str, Any], *keys: str) -> str | None:
|
||||
"""Return the first non-empty metadata value matching the provided keys."""
|
||||
for key in keys:
|
||||
value = metadata.get(key)
|
||||
if value not in (None, ""):
|
||||
if isinstance(value, str) and value:
|
||||
return value
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user