Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ requires-python = ">=3.12"
dependencies = [
"httpx>=0.27.0",
"pyyaml>=6.0",
"pydantic>=2.0.0",
"pydantic>=2.11.0",
]

[project.optional-dependencies]
Expand Down
14 changes: 9 additions & 5 deletions src/bloomy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ def _parse_optional_float(v: Any) -> float | None:
return float(v)


# Reusable annotated types for optional fields that may come as empty strings
OptionalDatetime = Annotated[datetime | None, BeforeValidator(_parse_optional_datetime)]
OptionalFloat = Annotated[float | None, BeforeValidator(_parse_optional_float)]
# Reusable annotated types for optional fields that may come as empty strings.
# PEP 695 named aliases (requires pydantic>=2.11 for full support).
type OptionalDatetime = Annotated[
datetime | None, BeforeValidator(_parse_optional_datetime)
]
type OptionalFloat = Annotated[float | None, BeforeValidator(_parse_optional_float)]
# Coerces a nullable value (e.g. a datetime or None) into a bool (present = True)
IsPresent = Annotated[bool, BeforeValidator(lambda v: v is not None and v != "")]
type IsPresent = Annotated[bool, BeforeValidator(lambda v: v is not None and v != "")]


class GoalStatus(StrEnum):
Expand Down Expand Up @@ -371,7 +374,8 @@ class HeadlineDetails(BloomyBaseModel):
closed_at: str | None = None


# HeadlineListItem is identical to HeadlineDetails - use type alias
# HeadlineListItem is identical to HeadlineDetails - use assignment alias so the
# name remains callable (PEP 695 `type` produces a non-callable TypeAliasType).
HeadlineListItem = HeadlineDetails


Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading