diff --git a/scripts/utils/qdrant_faces.py b/scripts/utils/qdrant_faces.py index 37a865e..f40aad5 100644 --- a/scripts/utils/qdrant_faces.py +++ b/scripts/utils/qdrant_faces.py @@ -41,7 +41,7 @@ BATCH_SIZE = int(os.environ.get("QDRANT_BATCH_SIZE", "100")) def qdrant_request(method: str, path: str, body: dict = None) -> dict: """Make HTTP request to Qdrant""" url = f"{QDRANT_URL}{path}" - data = json.dumps(body).encode() if body else None + data = json.dumps(body).encode() if body is not None else None req = urllib.request.Request(url, data=data, method=method) req.add_header("Content-Type", "application/json") req.add_header("Api-Key", QDRANT_API_KEY) @@ -605,7 +605,7 @@ def count_seeds(source: str = None) -> int: """ ensure_seeds_collection() - body = {} # Always pass empty body for count + body = {} if source: body["filter"] = { "must": [ @@ -613,7 +613,7 @@ def count_seeds(source: str = None) -> int: ] } - result = qdrant_request("POST", f"/collections/{SEEDS_COLLECTION}/points/count", body if body else {}) + result = qdrant_request("POST", f"/collections/{SEEDS_COLLECTION}/points/count", body) return result.get("result", {}).get("count", 0)