Skip to content

Commit

Permalink
revert: types changes
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
  • Loading branch information
aarnphm committed Aug 5, 2022
1 parent be5df55 commit 6ab9a41
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions bentoml/_internal/io_descriptors/base.py
Expand Up @@ -5,12 +5,13 @@
from abc import abstractmethod
from typing import TYPE_CHECKING

from starlette.requests import Request
from starlette.responses import Response

if TYPE_CHECKING:
from types import UnionType

from typing_extensions import Self
from starlette.requests import Request
from starlette.responses import Response

from bentoml.grpc.v1.service_pb2 import Request as GRPCRequest
from bentoml.grpc.v1.service_pb2 import Response as GRPCResponse
Expand All @@ -19,13 +20,6 @@
from ..context import InferenceApiContext as Context
from ..server.grpc.types import BentoServicerContext

InputType = (
UnionType
| t.Type[t.Any]
| LazyType[t.Any]
| dict[str, t.Type[t.Any] | UnionType | LazyType[t.Any]]
)


IOPyObj = t.TypeVar("IOPyObj")

Expand Down Expand Up @@ -81,19 +75,26 @@ def accepted_proto_fields(self) -> list[str]:
return self._proto_fields

@abstractmethod
def input_type(self) -> InputType:
def input_type(
self,
) -> t.Union[
"UnionType",
t.Type[t.Any],
"LazyType[t.Any]",
t.Dict[str, t.Union[t.Type[t.Any], "UnionType", "LazyType[t.Any]"]],
]:
...

@abstractmethod
def openapi_schema_type(self) -> dict[str, str]:
def openapi_schema_type(self) -> t.Dict[str, str]:
...

@abstractmethod
def openapi_request_schema(self) -> dict[str, t.Any]:
def openapi_request_schema(self) -> t.Dict[str, t.Any]:
...

@abstractmethod
def openapi_responses_schema(self) -> dict[str, t.Any]:
def openapi_responses_schema(self) -> t.Dict[str, t.Any]:
...

@abstractmethod
Expand Down

0 comments on commit 6ab9a41

Please sign in to comment.