core: Bump ruff version to 0.11 (#30519)

Changes are from the new TC006 rule:
https://docs.astral.sh/ruff/rules/runtime-cast-value/
TC006 is auto-fixed.
This commit is contained in:
Christophe Bornet
2025-03-27 18:01:49 +01:00
committed by GitHub
parent 59908f04d4
commit e181d43214
44 changed files with 243 additions and 233 deletions

View File

@@ -136,7 +136,7 @@ class Blob(BaseMedia):
case that value will be used instead.
"""
if self.metadata and "source" in self.metadata:
return cast(Optional[str], self.metadata["source"])
return cast("Optional[str]", self.metadata["source"])
return str(self.path) if self.path else None
@model_validator(mode="before")