Skip to content

fix(python): add collection close method#567

Open
sjh9714 wants to merge 1 commit into
alibaba:mainfrom
sjh9714:fix-python-collection-close
Open

fix(python): add collection close method#567
sjh9714 wants to merge 1 commit into
alibaba:mainfrom
sjh9714:fix-python-collection-close

Conversation

@sjh9714

@sjh9714 sjh9714 commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Closes #563.

Adds Collection.close() to release the Python wrapper's underlying _Collection handle, so callers can explicitly drop native resources before reopening or removing a collection path. The concurrent-open test now records the opened path before closing the worker handle.

Note: I used Codex to help prepare this change, reviewed the final diff, and ran the listed checks locally.

Testing

  • git submodule update --init --recursive --depth=1
  • python3 -m venv .venv
  • .venv/bin/python -m pip install --upgrade pip setuptools wheel
  • .venv/bin/python -m pip install -e ".[test]"
  • .venv/bin/python -m pytest python/tests/detail/test_collection_open.py::TestCollectionOpen::test_close_releases_collection_for_reopen -q
  • .venv/bin/python -m pytest python/tests/detail/test_collection_open.py -q
  • .venv/bin/python -m compileall -q python/zvec/model/collection.py python/tests/detail/test_collection_open.py
  • .venv/bin/python -m pip install "ruff>=0.4"
  • .venv/bin/python -m ruff check python/zvec/model/collection.py python/tests/detail/test_collection_open.py
  • git diff --check

@sjh9714 sjh9714 requested a review from Cuiyus as a code owner July 8, 2026 15:32
@CLAassistant

CLAassistant commented Jul 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

[Bug]: Python Collection 缺少 close() 方法,导致 Windows 文件锁无法释放

3 participants