Merge branch 'develop' into feature/remove_unused_validators

This commit is contained in:
montezdesousa
2024-02-12 13:33:27 +00:00
committed by GitHub
30 changed files with 421 additions and 134 deletions

View File

@@ -21,9 +21,9 @@ class WorldNewsQueryParams(QueryParams):
"""World News Query."""
limit: NonNegativeInt = Field(
default=20,
default=2500,
description=QUERY_DESCRIPTIONS.get("limit", "")
+ " Here its the no. of articles to return.",
+ " The number of articles to return.",
)
start_date: Optional[dateType] = Field(
default=None, description=QUERY_DESCRIPTIONS.get("start_date", "")
@@ -38,7 +38,7 @@ class WorldNewsQueryParams(QueryParams):
"""Populate start date if empty."""
if not v:
now = datetime.now().date()
v = now - relativedelta(years=1)
v = now - relativedelta(weeks=2)
return v
@field_validator("end_date", mode="before")
@@ -55,11 +55,11 @@ class WorldNewsData(Data):
date: datetime = Field(
description=DATA_DESCRIPTIONS.get("date", "")
+ " Here it is the published date of the news."
+ " The published date of the article."
)
title: str = Field(description="Title of the news.")
title: str = Field(description="Title of the article.")
images: Optional[List[Dict[str, str]]] = Field(
default=None, description="Images associated with the news."
default=None, description="Images associated with the article."
)
text: Optional[str] = Field(default=None, description="Text/body of the news.")
url: Optional[str] = Field(default=None, description="URL of the news.")
text: Optional[str] = Field(default=None, description="Text/body of the article.")
url: Optional[str] = Field(default=None, description="URL to the article.")