Revert current_date type to Any in ValidationContext

The field receives raw YAML data from commented_map.get() which can
be anything the user provides, not just Date | str | None. The
get_current_date function already handles arbitrary input defensively
with isinstance checks and falls back to Date.today().
This commit is contained in:
Sina Atalay
2026-03-24 19:25:07 +03:00
parent 441214e8c8
commit 26e9c6d86f

View File

@@ -1,7 +1,7 @@
import pathlib
from dataclasses import dataclass
from datetime import date as Date
from typing import cast
from typing import Any, cast
import pydantic
@@ -9,7 +9,7 @@ import pydantic
@dataclass
class ValidationContext:
input_file_path: pathlib.Path | None = None
current_date: Date | str | None = None
current_date: Any = None
def get_input_file_path(info: pydantic.ValidationInfo) -> pathlib.Path | None: