Severusll opened a new pull request, #1413:
URL: https://github.com/apache/flink-agents/pull/1413

   Linked issue: #1394
   
   Fixes #1394. The proposed scope was confirmed in [the issue 
discussion](https://github.com/apache/flink-agents/issues/1394#issuecomment-6936941688).
   
   ### Purpose of change
   
   Reading 101 existing documents by explicit IDs previously returned only 100 
because the Chroma adapter forwarded its default scan limit. This change 
returns the matching explicitly requested documents, consistent with 
`BaseVectorStore.get`.
   
   #### Runtime flow
   
   `ChromaVectorStore.get` resolves filters and calls the underlying 
collection. When `ids is not None`, it supplies `limit=None`; otherwise it 
passes the caller's scan limit. Result-to-Document conversion is unchanged.
   
   #### Key decisions
   
   ID selection already bounds the read. Removing the limit only for that 
branch retains the bounded default for scans and avoids changing the public 
signature.
   
   ### Behavioral Semantics
   
   #### Interaction decisions
   
   | IDs | limit | Behavior |
   |---|---|---|
   | supplied | default / explicit | Return matching selected IDs without the 
scan cap |
   | absent | default 100 / explicit | Keep the requested scan cap |
   | absent | None | Keep the existing unbounded scan |
   
   #### Behavioral contracts
   
   1. Two existing IDs with `limit=1` return both documents.
   2. 101 existing IDs with the default limit return all 101 documents.
   3. Filters still exclude nonmatching selected documents, and missing IDs 
yield no document.
   4. Scans keep their default and explicit limits.
   
   #### Failure behavior
   
   Backend exceptions propagate through the existing path. No retry or 
exception translation is introduced.
   
   ### Tests
   
   Before the implementation change, all three new tests failed on main at 
`5b0b553`, with the expected missing-ID assertions.
   
   After the change, the complete Chroma test module reports **24 passed, 1 
skipped**. The skipped test is the cloud test because `TEST_API_KEY` is unset. 
The existing Pydantic warning about Chroma Settings mixing V1/V2 models is also 
present on the base revision.
   
   | Contract | Regression coverage |
   |---|---|
   | 1 | `test_get_ids_ignores_explicit_limit` |
   | 2 and default scan cap | `test_get_ids_exceeds_default_limit` |
   | 3 | `test_get_ids_preserves_filter_and_missing_id_behavior` |
   | 4 | New default-scan assertion and existing explicit-limit / 
unbounded-scan tests |
   
   Commands, with the checkout's `python/` first on PYTHONPATH and test 
dependencies installed
   
   ```shell
   python -m pytest -q 
python/flink_agents/integrations/vector_stores/chroma/tests/test_chroma_vector_store.py
   ruff check --no-fix 
python/flink_agents/integrations/vector_stores/chroma/chroma_vector_store.py 
python/flink_agents/integrations/vector_stores/chroma/tests/test_chroma_vector_store.py
   ruff format --check 
python/flink_agents/integrations/vector_stores/chroma/chroma_vector_store.py 
python/flink_agents/integrations/vector_stores/chroma/tests/test_chroma_vector_store.py
   git diff --check
   ```
   
   Ruff 0.11.13 check and format check pass for both changed files. The 
independent 101-ID reproduction also passes against the fixed source.
   
   The full Python unit suite, Java suite and Flink end-to-end suite have not 
been run. Verification uses Python 3.12.1, ChromaDB 1.0.21, Pydantic 2.12.5 and 
pytest 9.0.3.
   
   ### API
   
   No public signature change. Calls supplying IDs can return more matching 
documents than before, including when a small explicit limit is supplied. This 
restores the documented base contract. Scans keep their existing limits.
   
   ### Documentation
   
   - [ ] `doc-needed`
   - [x] `doc-not-needed`
   - [ ] `doc-included`
   
   The existing base API documentation already specifies the intended behavior.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   - [x] Yes
   - [ ] No
   
   Generated-by: Codex 0.166.0-alpha.5.1 (gpt-6.1-sol)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to