From 76ae0ef3986ddfbf227a43d3f4d9bb4c878f89e8 Mon Sep 17 00:00:00 2001 From: Future-Outlier Date: Thu, 24 Oct 2024 09:34:03 +0800 Subject: [PATCH] fix syntax to support python 3.9 Signed-off-by: Future-Outlier --- flytekit/extras/pydantic/decorator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flytekit/extras/pydantic/decorator.py b/flytekit/extras/pydantic/decorator.py index 5cd46c35a1..869d485ff2 100644 --- a/flytekit/extras/pydantic/decorator.py +++ b/flytekit/extras/pydantic/decorator.py @@ -1,5 +1,5 @@ import logging -from typing import Any, Callable, TypeVar +from typing import Any, Callable, TypeVar, Union logger = logging.getLogger(__name__) @@ -18,7 +18,7 @@ from typing_extensions import Literal as typing_literal def model_serializer( - __f: Callable[..., Any] | None = None, + __f: Union[Callable[..., Any], None] = None, *, mode: typing_literal["plain", "wrap"] = "plain", when_used: typing_literal["always", "unless-none", "json", "json-unless-none"] = "always",