Skip to content

Commit

Permalink
add return types
Browse files Browse the repository at this point in the history
  • Loading branch information
matyson committed May 15, 2024
1 parent bf20bda commit bb8e622
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def read_root():


@app.get("/tensorboard")
def get_tensorboard_instance(name: str):
def get_tensorboard_instance(name: str) -> TensorboardInstance:
if contains(name):
return get(name)
raise HTTPException(status_code=404, detail="Instance not found")
Expand All @@ -45,7 +45,7 @@ def get_tensorboard_instance(name: str):
@app.post("/tensorboard/start")
def start_tensorboard_instance(
request: Annotated[CreateTensorboardInstanceRequest, Body]
):
) -> TensorboardInstance:
logdir = request.logdir
name = request.name
if contains(name):
Expand All @@ -70,5 +70,5 @@ def kill_tensorboard_instance(name: str):


@app.get("/tensorboard/instances")
def get_tensorboard_instances():
def get_tensorboard_instances() -> list[TensorboardInstance]:
return get_all()

0 comments on commit bb8e622

Please sign in to comment.