Skip to content

Commit f8c5e7a

Browse files
committed
Set a default type for SuccessfulT
Mypy gets unhappy when we instantiate a generic class without declaring its type (aka infer from the inital value). As a workaround just declare our default type as Any.
1 parent 31adea4 commit f8c5e7a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/guidellm/benchmark/benchmark.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import random
22
import uuid
3-
from typing import Any, Dict, Generic, List, Literal, Optional, TypeVar, Union
3+
from typing import Any, Dict, Generic, List, Literal, Optional, Union
44

55
from pydantic import Field, computed_field
6+
from typing_extensions import TypeVar
67

78
from guidellm.benchmark.profile import (
89
AsyncProfile,
@@ -46,7 +47,7 @@
4647
]
4748

4849

49-
SuccessfulT = TypeVar("SuccessfulT")
50+
SuccessfulT = TypeVar("SuccessfulT", default=Any)
5051
ErroredT = TypeVar("ErroredT", default=SuccessfulT)
5152
IncompleteT = TypeVar("IncompleteT", default=ErroredT)
5253
class StatusBreakdown(StandardBaseModel, Generic[SuccessfulT, ErroredT, IncompleteT]):

0 commit comments

Comments
 (0)