data_types: fix module by pylint hints

This commit is contained in:
Richard Kubíček
2025-02-08 14:38:47 +01:00
parent 3c5ea2e2e2
commit 8786ea981f

View File

@@ -60,8 +60,10 @@ class Date:
"""
try:
return datetime.strptime(date_str, "%Y-%m-%d")
except ValueError:
raise ValueError(f"Date must be in format YYYY-MM-DD, got: {date_str}")
except ValueError as exc:
raise ValueError(
f"Date must be in format YYYY-MM-DD, got: {date_str}"
) from exc
def __str__(self) -> str:
"""