Skip to content

minor: add function overload in python api#197

Merged
feihongxu0824 merged 2 commits intomainfrom
minor/python_api
Mar 4, 2026
Merged

minor: add function overload in python api#197
feihongxu0824 merged 2 commits intomainfrom
minor/python_api

Conversation

@zhourrr
Copy link
Collaborator

@zhourrr zhourrr commented Mar 4, 2026

No description provided.

@greptile-apps
Copy link

greptile-apps bot commented Mar 4, 2026

Greptile Summary

Added Python @overload decorators to four collection methods (insert, upsert, update, delete) to provide better type hints for IDEs and static type checkers. When a single document or ID is passed, the return type is correctly inferred as Status; when a list is passed, the return type is list[Status]. This improves developer experience with better autocomplete and type safety without changing any runtime behavior.

Confidence Score: 5/5

  • This PR is safe to merge with no risk
  • The changes are purely additive type annotations using Python's @overload decorator, which only affects static type checking and IDE autocomplete. No runtime behavior is modified, and the overload signatures correctly match the existing implementation logic.
  • No files require special attention

Important Files Changed

Filename Overview
python/zvec/model/collection.py Added @overload decorators for type-safe method signatures on insert, upsert, update, and delete methods

Last reviewed commit: 9d58c4a

@zhourrr zhourrr requested a review from Cuiyus March 4, 2026 07:24
@zhourrr zhourrr requested a review from feihongxu0824 March 4, 2026 08:06
@zhourrr zhourrr force-pushed the minor/python_api branch from a661973 to 9d58c4a Compare March 4, 2026 09:35
@Cuiyus
Copy link
Collaborator

Cuiyus commented Mar 4, 2026

@greptile

@feihongxu0824 feihongxu0824 merged commit dbcabd8 into main Mar 4, 2026
10 checks passed
@feihongxu0824 feihongxu0824 deleted the minor/python_api branch March 4, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants