Skip to content

Commit

Permalink
fix: change types back compatible to python 3.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vgulerianb committed Jun 12, 2023
1 parent 61fd0ec commit 260b2d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/api/fury.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from functools import lru_cache
from sqlalchemy.orm import Session
from pydantic import BaseModel, Field
from typing import Annotated, Dict, Any
from typing import Annotated, Dict, Any, Union
from sqlalchemy.exc import IntegrityError
from fastapi import APIRouter, Depends, Header, Request, Response, Query

Expand Down Expand Up @@ -302,7 +302,7 @@ def list_fury_actions(
#


def validate_action(fury_action: ActionRequest | ActionUpdateRequest, resp: Response) -> tuple[Node, Response]:
def validate_action(fury_action: Union[ActionRequest, ActionUpdateRequest], resp: Response) -> tuple[Node, Response]:
# if the function is to be updated then perform the full validation same as when creating a new action
if len(fury_action.outputs) != 1:
resp.status_code = 400
Expand Down
2 changes: 1 addition & 1 deletion server/fury/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ def from_json(cls, data: str):
return cls.from_dict(json.loads(data))

def __call__(
self, data: str | Dict[str, Any], thoughts_callback: Optional[Callable] = None, print_thoughts: bool = False
self, data: Union[str, Dict[str, Any]], thoughts_callback: Optional[Callable] = None, print_thoughts: bool = False
) -> Tuple[Var, Dict[str, Any]]:
if not isinstance(data, dict):
assert isinstance(data, str), f"Invalid data type: {type(data)}"
Expand Down

0 comments on commit 260b2d2

Please sign in to comment.