Skip to content

fix: allow not-annotated args to be compatible for old handlers for now #529

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/cocoindex/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down