From d0e712760d76e6ba3c0215775ff027c73ade42c0 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Thu, 8 Jan 2026 18:53:03 +0100 Subject: [PATCH] chore: improve check_environment.py script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Filter out expired records using ttl_expiry - Add namespace: prefix to headers for clarity 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- check_environment.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/check_environment.py b/check_environment.py index 1443a7f..c99ccdd 100644 --- a/check_environment.py +++ b/check_environment.py @@ -25,12 +25,20 @@ async def main(): namespaces = ["weather", "air_quality", "forecast", "sun", "news"] + now_ms = int(time.time() * 1000) + for ns in namespaces: try: + from qdrant_client.models import Range + + # Filter by namespace AND not expired results = qdrant.scroll( collection_name=collection, scroll_filter=Filter( - must=[FieldCondition(key="namespace", match=MatchValue(value=ns))] + must=[ + FieldCondition(key="namespace", match=MatchValue(value=ns)), + FieldCondition(key="ttl_expiry", range=Range(gt=now_ms)), + ] ), limit=10, with_payload=True, @@ -38,7 +46,7 @@ async def main(): ) points = results[0] - print(f"=== {ns.upper()} ({len(points)} records) ===") + print(f"=== {ns.upper()} [namespace:{ns}] ({len(points)} records) ===") if not points: print(" (no data)")