fix: canonicalize numeric legacy timestamps
Some checks failed
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / pytest-smoke (push) Failing after 4s

This commit is contained in:
tegwick 2026-08-21 18:01:02 +02:00
parent 826874a47e
commit b649ea7168
2 changed files with 18 additions and 0 deletions

View file

@ -60,6 +60,8 @@ def _datetime(value: Any, default: datetime | None = None) -> datetime:
return value if value.tzinfo else value.replace(tzinfo=timezone.utc)
if isinstance(value, str) and value:
return datetime.fromisoformat(value.replace("Z", "+00:00"))
if isinstance(value, (int, float)) and not isinstance(value, bool):
return datetime.fromtimestamp(value, tz=timezone.utc)
return default or _now()