Skip to content

Commit 9a04e9a

Browse files
committed
Fix Pydantic being unappy with future annotations
1 parent 7db8aa1 commit 9a04e9a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

meilisearch/models/task.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import annotations
2-
31
from typing import Any, Dict, Optional
42

53
from camel_converter.pydantic_base import CamelBase
@@ -17,18 +15,18 @@ class Task(CamelBase):
1715
finished_at: str
1816

1917
class TaskInfo(CamelBase):
20-
task_uid: str | None
18+
task_uid: Optional[str]
2119
index_uid: str
2220
status: str
2321
type: str
2422
details: Optional[Dict[str, Any]]
25-
duration: str | None
23+
duration: Optional[str]
2624
enqueued_at: str
27-
started_at: str | None
28-
finished_at: str | None
25+
started_at: Optional[str]
26+
finished_at: Optional[str]
2927

3028
class TaskResults:
31-
def __init__(self, resp: dict[str, Any]) -> None:
29+
def __init__(self, resp: Dict[str, Any]) -> None:
3230
self.results: list[Task] = [Task(**task) for task in resp['results']]
3331
self.limit: int = resp['limit']
3432
self.from_: int = resp['from']

0 commit comments

Comments
 (0)