mirror of
https://github.com/beshu-tech/deltaglider.git
synced 2026-11-13 13:53:28 +01: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:
1 parent
cf02da7e0b
commit
b1238a62d8
1 file changed
+1
-1
@@ -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