chore(rebase): reconcile with develop and apply ruff format
After rebasing onto current develop: - chroma.py: keep develop's quarantine_stale_hnsw + UnsupportedFilterError validation alongside this PR's _pin_hnsw_threads retrofit. - tests/test_backends.py: combine quarantine_stale_hnsw and _pin_hnsw_threads test sections; ruff format. - miner.py: propagate the new `files=` kwarg (added on develop in #1183 for the init -> mine flow) through _mine_impl so the caller can pass a pre-scanned file list under the global lock.
This commit is contained in:
@@ -153,9 +153,7 @@ def _pin_hnsw_threads(collection) -> None:
|
|||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
collection.modify(
|
collection.modify(
|
||||||
configuration=UpdateCollectionConfiguration(
|
configuration=UpdateCollectionConfiguration(hnsw=UpdateHNSWConfiguration(num_threads=1))
|
||||||
hnsw=UpdateHNSWConfiguration(num_threads=1)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.debug("_pin_hnsw_threads modify failed", exc_info=True)
|
logger.debug("_pin_hnsw_threads modify failed", exc_info=True)
|
||||||
|
|||||||
@@ -1005,6 +1005,7 @@ def mine(
|
|||||||
dry_run=dry_run,
|
dry_run=dry_run,
|
||||||
respect_gitignore=respect_gitignore,
|
respect_gitignore=respect_gitignore,
|
||||||
include_ignored=include_ignored,
|
include_ignored=include_ignored,
|
||||||
|
files=files,
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -1018,6 +1019,7 @@ def mine(
|
|||||||
dry_run=dry_run,
|
dry_run=dry_run,
|
||||||
respect_gitignore=respect_gitignore,
|
respect_gitignore=respect_gitignore,
|
||||||
include_ignored=include_ignored,
|
include_ignored=include_ignored,
|
||||||
|
files=files,
|
||||||
)
|
)
|
||||||
except MineAlreadyRunning:
|
except MineAlreadyRunning:
|
||||||
print(
|
print(
|
||||||
@@ -1037,6 +1039,7 @@ def _mine_impl(
|
|||||||
dry_run: bool = False,
|
dry_run: bool = False,
|
||||||
respect_gitignore: bool = True,
|
respect_gitignore: bool = True,
|
||||||
include_ignored: list = None,
|
include_ignored: list = None,
|
||||||
|
files: list = None,
|
||||||
):
|
):
|
||||||
project_path = Path(project_dir).expanduser().resolve()
|
project_path = Path(project_dir).expanduser().resolve()
|
||||||
config = load_config(project_dir)
|
config = load_config(project_dir)
|
||||||
|
|||||||
@@ -483,9 +483,7 @@ def test_get_collection_applies_retrofit_on_existing_palace(tmp_path):
|
|||||||
|
|
||||||
# Simulate a legacy palace: create collection without num_threads
|
# Simulate a legacy palace: create collection without num_threads
|
||||||
bootstrap_client = chromadb.PersistentClient(path=str(palace_path))
|
bootstrap_client = chromadb.PersistentClient(path=str(palace_path))
|
||||||
bootstrap_client.create_collection(
|
bootstrap_client.create_collection("mempalace_drawers", metadata={"hnsw:space": "cosine"})
|
||||||
"mempalace_drawers", metadata={"hnsw:space": "cosine"}
|
|
||||||
)
|
|
||||||
del bootstrap_client # drop reference so a fresh client reopens cleanly
|
del bootstrap_client # drop reference so a fresh client reopens cleanly
|
||||||
|
|
||||||
wrapper = ChromaBackend().get_collection(
|
wrapper = ChromaBackend().get_collection(
|
||||||
@@ -494,6 +492,4 @@ def test_get_collection_applies_retrofit_on_existing_palace(tmp_path):
|
|||||||
create=False,
|
create=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
assert (
|
assert wrapper._collection.configuration_json["hnsw"]["num_threads"] == 1
|
||||||
wrapper._collection.configuration_json["hnsw"]["num_threads"] == 1
|
|
||||||
)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user