From 76689807ab06ee4b57f58e643f1f5b5ff24bf2d6 Mon Sep 17 00:00:00 2001 From: LJ Date: Tue, 20 May 2025 15:19:20 -0700 Subject: [PATCH] fix: allow not-annotated args to be compatible for old handlers for now --- python/cocoindex/flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cocoindex/flow.py b/python/cocoindex/flow.py index db53004..d137895 100644 --- a/python/cocoindex/flow.py +++ b/python/cocoindex/flow.py @@ -657,7 +657,7 @@ async def _update_flow(name: str, fl: Flow) -> tuple[str, _engine.IndexUpdateInf def _get_data_slice_annotation_type(data_slice_type: Type[DataSlice[T]]) -> Type[T] | None: type_args = get_args(data_slice_type) - if data_slice_type is DataSlice: + if data_slice_type is inspect.Parameter.empty or data_slice_type is DataSlice: return None if get_origin(data_slice_type) != DataSlice or len(type_args) != 1: raise ValueError(f"Expect a DataSlice[T] type, but got {data_slice_type}")