Skip to content

Commit

Permalink
return string only
Browse files Browse the repository at this point in the history
  • Loading branch information
yxtay committed Nov 13, 2024
1 parent 69b0d84 commit e3ac420
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/e2e/bento_new_sdk/test_asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ class Model:
model = {"hello": "world"}

@bentoml.api()
def get(self, key: str) -> str | None:
return self.model.get(key)
def get(self, key: str) -> str:
return self.model.get(key, "")


@bentoml.service(metrics={"enabled": False})
class Service:
model = bentoml.depends(Model)

@bentoml.api()
def get(self, key: str) -> dict[str, str | None]:
def get(self, key: str) -> dict[str, str]:
return {"value": self.model.get(key)}


Expand Down

0 comments on commit e3ac420

Please sign in to comment.