Skip to content

Commit 260b2d2

Browse files
committed
fix: change types back compatible to python 3.9.2
1 parent 61fd0ec commit 260b2d2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

server/api/fury.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from functools import lru_cache
55
from sqlalchemy.orm import Session
66
from pydantic import BaseModel, Field
7-
from typing import Annotated, Dict, Any
7+
from typing import Annotated, Dict, Any, Union
88
from sqlalchemy.exc import IntegrityError
99
from fastapi import APIRouter, Depends, Header, Request, Response, Query
1010

@@ -302,7 +302,7 @@ def list_fury_actions(
302302
#
303303

304304

305-
def validate_action(fury_action: ActionRequest | ActionUpdateRequest, resp: Response) -> tuple[Node, Response]:
305+
def validate_action(fury_action: Union[ActionRequest, ActionUpdateRequest], resp: Response) -> tuple[Node, Response]:
306306
# if the function is to be updated then perform the full validation same as when creating a new action
307307
if len(fury_action.outputs) != 1:
308308
resp.status_code = 400

server/fury/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ def from_json(cls, data: str):
745745
return cls.from_dict(json.loads(data))
746746

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

0 commit comments

Comments
 (0)