From f681ab980d1b9db6f891646610a3320d4738a8f3 Mon Sep 17 00:00:00 2001 From: Gregor Klevze Date: Tue, 31 Mar 2026 20:36:23 +0200 Subject: [PATCH] fix: coverage_pct and ram_estimate use points_count (vectors_count deprecated in Qdrant v1.x) --- qdrant/main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qdrant/main.py b/qdrant/main.py index a7276ce..43e2f19 100644 --- a/qdrant/main.py +++ b/qdrant/main.py @@ -236,14 +236,16 @@ def inspect(): quant = cfg.quantization_config params = cfg.params - # Estimate raw RAM footprint: vectors * dim * 4 bytes * 1.5 safety factor - vec_count = info.vectors_count or 0 + # `vectors_count` is deprecated and returns 0 in newer Qdrant versions; + # use `points_count` as the canonical count for coverage and RAM estimates. + points_count = info.points_count or 0 + vec_count = info.vectors_count or points_count # kept for backwards compat display vec_dim = ( params.vectors.size if hasattr(params.vectors, "size") else VECTOR_DIM ) - ram_estimate_mb = round(vec_count * vec_dim * 4 * 1.5 / 1_048_576, 1) + ram_estimate_mb = round(points_count * vec_dim * 4 * 1.5 / 1_048_576, 1) result[name] = { "status": info.status.value if info.status else None, @@ -272,7 +274,7 @@ def inspect(): k: { "type": v.data_type.value if hasattr(v.data_type, "value") else str(v.data_type), "points": v.points, - "coverage_pct": round(v.points / max(vec_count, 1) * 100, 1), + "coverage_pct": round(v.points / max(points_count, 1) * 100, 1), } for k, v in (info.payload_schema or {}).items() },