You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
async Collection.exists() still swallows all exceptions (PR #1950 fixed sync path only, async regression remains) #2100
async_collection.exists() in weaviate/collections/collection/async_.py catches all exceptions and returns False, making it impossible to distinguish "collection not found" from "connection error / auth failure / timeout":
will silently try to create a collection every time the server is unreachable — which may succeed with wrong configuration, fail with a confusing error, or mask a network outage entirely.
Issue #1799 reported this exact problem. PR #1950 (merged Feb 2026) fixed the synchronous path in weaviate/collections/collection/sync.py:
# sync.py — correctly re-raises on non-404exceptUnexpectedStatusCodeErrorase:
ife.status_code==404:
returnFalseraise
But the async counterpart in async_.py was never updated and still has the bare except Exception: return False. A collaborator noted on the closed issue: "Pretty sure this was not fixed!" — and indeed it was not for the async client.
I'd like to work on this. Looking at the code, sync.py's exists() (lines 201-209) already handles this correctly by catching UnexpectedStatusCodeError and only swallowing 404s — I'll mirror that exact pattern into async_.py's exists(). I also noticed there's no existing test coverage for exists() on either the sync or async path, which is likely how the async gap in #1950 went unnoticed — I'll add tests for both to close that gap. Will open a PR referencing this issue once it's ready.
Activity
adityaanikam commentedon Jul 23, 2026
I'd like to work on this. Looking at the code, sync.py's exists() (lines 201-209) already handles this correctly by catching UnexpectedStatusCodeError and only swallowing 404s — I'll mirror that exact pattern into async_.py's exists(). I also noticed there's no existing test coverage for exists() on either the sync or async path, which is likely how the async gap in #1950 went unnoticed — I'll add tests for both to close that gap. Will open a PR referencing this issue once it's ready.
fix(collections): re-raise non-404 errors from async Collection.exists()
Merge pull request #2112 from Anai-Guo/fix/async-collection-exists-re…