chore: improve check_environment.py script
- 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 <noreply@anthropic.com>
This commit is contained in:
+10
-2
@@ -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)")
|
||||
|
||||
Reference in New Issue
Block a user