Skip to content

GetAsync with a limit of 0 reads the collection of a client made by name first, so a collection that does not exist throws - #125

Merged
Laurianti merged 2 commits into
mainfrom
fix-210
Oct 11, 2026
Merged

Laurianti merged 2 commits into
mainfrom
fix-210

Conversation

@Laurianti

Copy link
Copy Markdown
Member

Fixes GetAsync with a limit of 0 on a collection client made by name, when the collection does not exist.

  • Before: a collection client made by name returned an empty list for GetAsync(limit: 0) without any request, also when the collection did not exist.
  • Now: it reads its collection first, as the other reads do, so a collection that does not exist throws the same ChromaException. A limit of 0 still sends no get, since Chroma 0.6.3 would take it as no limit.
  • Compared with the Python client: it sends the get with limit: 0 as it is, and on Chroma 0.6.3 gets every record back; this client sends no get, and throws when the collection does not exist.
  • Tests: CollectionClientGetTests.GetWithALimitOf0ByNameOnACollectionThatDoesNotExist, which fails on main, on Chroma 1.5.9 and on Chroma Cloud; the get tests pass on Chroma 0.6.3 too.
  • Docs: docs/queries-and-filters.md, and the column of the client in the KD-13 row of docs/COMPATIBILITY.md, which said "without a request".

…ame first, so a collection that does not exist throws
Copilot AI balanced review requested due to automatic review settings October 11, 2026 08:01
@Laurianti
Laurianti requested a review from a team as a code owner October 11, 2026 08:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The behavior, regression coverage, and documentation are aligned; only a non-blocking async-test cleanup remains.

1 open finding
What changed in this PR

Fixes zero-limit reads for collection clients created by name by resolving the collection before returning an empty result.

Changes:

  • Moves the zero-limit shortcut inside the collection operation wrapper.
  • Adds regression coverage for nonexistent named collections.
  • Updates query and compatibility documentation.
File Description
ChromaDB.Client/​ChromaCollectionClient.cs Resolves named collections before zero-limit returns.
ChromaDB.Client.Tests/​CollectionClientGetTests.cs Tests the missing-collection behavior.
docs/​queries-and-filters.md Documents zero-limit named-client semantics.
docs/​COMPATIBILITY.md Updates the KD-13 workaround description.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ChromaDB.Client.Tests/CollectionClientGetTests.cs Outdated
@Laurianti
Laurianti merged commit 6eb95ca into main Oct 11, 2026
27 of 28 checks passed
@Laurianti
Laurianti deleted the fix-210 branch October 11, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants