Fix new stats rows creating data in the old created column (#88013)

This commit is contained in:
J. Nick Koston 2023-02-13 21:53:37 -06:00 committed by GitHub
parent 3d9d79684d
commit 484027023c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -537,6 +537,8 @@ class StatisticsBase:
"""Create object from a statistics.""" """Create object from a statistics."""
return cls( # type: ignore[call-arg] return cls( # type: ignore[call-arg]
metadata_id=metadata_id, metadata_id=metadata_id,
created=None,
created_ts=time.time(),
start=None, start=None,
start_ts=dt_util.utc_to_timestamp(stats["start"]), start_ts=dt_util.utc_to_timestamp(stats["start"]),
mean=stats.get("mean"), mean=stats.get("mean"),