From 3fc6108b143b08ed00cb6ca85f8803eb9440f338 Mon Sep 17 00:00:00 2001 From: Kamil Rybacki Date: Tue, 16 Jul 2024 11:32:03 +0200 Subject: [PATCH] chore: Add default value for timestamp in FieldValidationErrorInfo class --- phaistos/exceptions.pyi | 2 +- phaistos/typings.pyi | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/phaistos/exceptions.pyi b/phaistos/exceptions.pyi index 16d180f..49f236f 100644 --- a/phaistos/exceptions.pyi +++ b/phaistos/exceptions.pyi @@ -11,4 +11,4 @@ class IncorrectFieldTypeError(ValueError): ... class FieldValidationErrorInfo: name: str message: str - timestamp: datetime.datetime + timestamp: datetime.datetime = dataclasses.field(default_factory=datetime.datetime.now) diff --git a/phaistos/typings.pyi b/phaistos/typings.pyi index d675d91..cdcca92 100644 --- a/phaistos/typings.pyi +++ b/phaistos/typings.pyi @@ -96,6 +96,7 @@ class TranspiledModelData(typing.TypedDict): context: typing.NotRequired[dict[str, typing.Any]] global_validator: typing.NotRequired[typing.Any] +@dataclasses.dataclass(kw_only=True) class ValidationResults: """ A dataclass that represents the results of a validation.