Skip to content

Commit ce9f60e

Browse files
bors[bot]Azanulalallema
authored
Merge #661
661: Task & TaskInfo datetime consistency r=alallema a=Azanul # Pull Request ## Related issue Fixes #615 ## What does this PR do? - Adds `datetime` type consistency across the SDK - Adapts corresponding tests ## PR checklist Please check if your PR fulfills the following requirements: - [X] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)? - [X] Have you read the contributing guidelines? - [X] Have you made sure that the title is accurate and descriptive of the changes? Co-authored-by: Azanul <[email protected]> Co-authored-by: Azanul Haque <[email protected]> Co-authored-by: Amélie <[email protected]>
2 parents d3f35fa + 23371ff commit ce9f60e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

meilisearch/models/task.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

3-
from typing import Any, Dict, List, Union
3+
from datetime import datetime
4+
from typing import Any, Dict, List, Optional, Union
45

56
from camel_converter.pydantic_base import CamelBase
67

@@ -13,18 +14,18 @@ class Task(CamelBase):
1314
details: Dict[str, Any]
1415
error: Union[Dict[str, Any], None]
1516
canceled_by: Union[int, None]
16-
duration: str
17-
enqueued_at: str
18-
started_at: str
19-
finished_at: str
17+
duration: Optional[str]
18+
enqueued_at: datetime
19+
started_at: Optional[datetime]
20+
finished_at: Optional[datetime]
2021

2122

2223
class TaskInfo(CamelBase):
2324
task_uid: int
2425
index_uid: Union[str, None]
2526
status: str
2627
type: str
27-
enqueued_at: str
28+
enqueued_at: datetime
2829

2930

3031
class TaskResults:

0 commit comments

Comments
 (0)