Skip to content

Commit d999966

Browse files
igorlslealvona
authored andcommitted
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 MemPalace#1183 for the init -> mine flow) through _mine_impl so the caller can pass a pre-scanned file list under the global lock.
1 parent 7d6e87e commit d999966

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

mempalace/backends/chroma.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ def _pin_hnsw_threads(collection) -> None:
153153
return
154154
try:
155155
collection.modify(
156-
configuration=UpdateCollectionConfiguration(
157-
hnsw=UpdateHNSWConfiguration(num_threads=1)
158-
)
156+
configuration=UpdateCollectionConfiguration(hnsw=UpdateHNSWConfiguration(num_threads=1))
159157
)
160158
except Exception:
161159
logger.debug("_pin_hnsw_threads modify failed", exc_info=True)

mempalace/miner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,7 @@ def mine(
10051005
dry_run=dry_run,
10061006
respect_gitignore=respect_gitignore,
10071007
include_ignored=include_ignored,
1008+
files=files,
10081009
)
10091010

10101011
try:
@@ -1018,6 +1019,7 @@ def mine(
10181019
dry_run=dry_run,
10191020
respect_gitignore=respect_gitignore,
10201021
include_ignored=include_ignored,
1022+
files=files,
10211023
)
10221024
except MineAlreadyRunning:
10231025
print(
@@ -1037,6 +1039,7 @@ def _mine_impl(
10371039
dry_run: bool = False,
10381040
respect_gitignore: bool = True,
10391041
include_ignored: list = None,
1042+
files: list = None,
10401043
):
10411044
project_path = Path(project_dir).expanduser().resolve()
10421045
config = load_config(project_dir)

tests/test_backends.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,7 @@ def test_get_collection_applies_retrofit_on_existing_palace(tmp_path):
483483

484484
# Simulate a legacy palace: create collection without num_threads
485485
bootstrap_client = chromadb.PersistentClient(path=str(palace_path))
486-
bootstrap_client.create_collection(
487-
"mempalace_drawers", metadata={"hnsw:space": "cosine"}
488-
)
486+
bootstrap_client.create_collection("mempalace_drawers", metadata={"hnsw:space": "cosine"})
489487
del bootstrap_client # drop reference so a fresh client reopens cleanly
490488

491489
wrapper = ChromaBackend().get_collection(
@@ -494,6 +492,4 @@ def test_get_collection_applies_retrofit_on_existing_palace(tmp_path):
494492
create=False,
495493
)
496494

497-
assert (
498-
wrapper._collection.configuration_json["hnsw"]["num_threads"] == 1
499-
)
495+
assert wrapper._collection.configuration_json["hnsw"]["num_threads"] == 1

0 commit comments

Comments
 (0)