Skip to content

Commit c693635

Browse files
committed
fix: executor minor cleanups (#561)
- Fix _quantize_vectors docstring: 'documents quantized' not 'processed' - Wrap test_migration_v1 assertions in try/finally for cleanup
1 parent 9603a6e commit c693635

2 files changed

Lines changed: 24 additions & 22 deletions

File tree

redisvl/migration/executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ def _quantize_vectors(
893893
checkpoint_path: Optional path for checkpoint file (enables resume)
894894
895895
Returns:
896-
Number of documents processed
896+
Number of documents quantized
897897
"""
898898
client = source_index._redis_client
899899
total_keys = len(keys)

tests/integration/test_migration_v1.py

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -102,26 +102,28 @@ def test_drop_recreate_plan_apply_validate_flow(redis_url, worker_id, tmp_path):
102102
query_check_file=str(query_check_path),
103103
)
104104

105-
assert report.result == "succeeded"
106-
assert report.validation.schema_match is True
107-
assert report.validation.doc_count_match is True
108-
assert report.validation.key_sample_exists is True
109-
assert report.validation.indexing_failures_delta == 0
110-
assert not report.validation.errors
111-
assert report.benchmark_summary.documents_indexed_per_second is not None
105+
try:
106+
assert report.result == "succeeded"
107+
assert report.validation.schema_match is True
108+
assert report.validation.doc_count_match is True
109+
assert report.validation.key_sample_exists is True
110+
assert report.validation.indexing_failures_delta == 0
111+
assert not report.validation.errors
112+
assert report.benchmark_summary.documents_indexed_per_second is not None
112113

113-
live_index = SearchIndex.from_existing(index_name, redis_url=redis_url)
114-
assert schemas_equal(live_index.schema.to_dict(), plan.merged_target_schema)
114+
live_index = SearchIndex.from_existing(index_name, redis_url=redis_url)
115+
assert schemas_equal(live_index.schema.to_dict(), plan.merged_target_schema)
115116

116-
validator = MigrationValidator()
117-
validation, _target_info, _duration = validator.validate(
118-
load_migration_plan(str(plan_path)),
119-
redis_url=redis_url,
120-
query_check_file=str(query_check_path),
121-
)
122-
assert validation.schema_match is True
123-
assert validation.doc_count_match is True
124-
assert validation.key_sample_exists is True
125-
assert not validation.errors
126-
127-
live_index.delete(drop=True)
117+
validator = MigrationValidator()
118+
validation, _target_info, _duration = validator.validate(
119+
load_migration_plan(str(plan_path)),
120+
redis_url=redis_url,
121+
query_check_file=str(query_check_path),
122+
)
123+
assert validation.schema_match is True
124+
assert validation.doc_count_match is True
125+
assert validation.key_sample_exists is True
126+
assert not validation.errors
127+
finally:
128+
live_index = SearchIndex.from_existing(index_name, redis_url=redis_url)
129+
live_index.delete(drop=True)

0 commit comments

Comments
 (0)