Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python: Introducing the Chroma Connector with the new vector store design #10678

Merged
merged 11 commits into from
Feb 27, 2025

Conversation

eavanvalkenburg
Copy link
Member

@eavanvalkenburg eavanvalkenburg commented Feb 25, 2025

Motivation and Context

Adds ChromaStore and ChromaConnector

Closes: #9926

Description

Contribution Checklist

@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner February 25, 2025 16:21
@markwallace-microsoft markwallace-microsoft added the python Pull requests for the Python Semantic Kernel label Feb 25, 2025
@eavanvalkenburg eavanvalkenburg marked this pull request as draft February 25, 2025 16:21
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 25, 2025

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
TOTAL18865236687% 
report-only-changed-files is enabled. No files were changed during this commit :)

Python Unit Test Overview

Tests Skipped Failures Errors Time
3185 5 💤 0 ❌ 0 🔥 1m 28s ⏱️

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

python/semantic_kernel/connectors/memory/chroma/chroma.py:301

  • [nitpick] The variable name 'filter' shadows Python’s built-in function. Consider renaming it (e.g., to 'filter_clause') to improve clarity.
for filter in options.filter.filters:

python/semantic_kernel/connectors/memory/chroma/chroma.py:205

  • Using a try-except block to catch an IndexError for an empty 'ids' list may hide other issues. Consider explicitly checking if the 'ids' list is empty before accessing its first element.
if isinstance(results["ids"][0], str):
@eavanvalkenburg eavanvalkenburg marked this pull request as ready for review February 26, 2025 10:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

python/semantic_kernel/connectors/memory/chroma/chroma.py:219

  • The conversion logic in _unpack_results that wraps each value in a list may lead to nested lists if the results are already in list form. Consider refining the conversion check to handle both single and multiple result scenarios explicitly.
if isinstance(results["ids"][0], str):

@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 26, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 26, 2025
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 27, 2025
github-merge-queue bot pushed a commit that referenced this pull request Feb 27, 2025
…sign (#10678)

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->
Adds ChromaStore and ChromaConnector

Closes: #9926

### Description

<!-- Describe your changes, the overall approach, the underlying design.
These notes will help understanding how your code works. Thanks! -->

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄

---------

Co-authored-by: Tao Chen <taochen@microsoft.com>
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 27, 2025
@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 27, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 27, 2025
eavanvalkenburg and others added 6 commits February 27, 2025 09:02
Add pytest unit tests for `ChromaCollection` and `ChromaStore` classes in `python/tests/unit/connectors/memory/chroma/test_chroma.py`.

* **Initialization Tests**
  - Test `ChromaCollection` initialization.
  - Test `ChromaStore` initialization.

* **Collection Management Tests**
  - Test `ChromaCollection` methods: `_get_collection`, `does_collection_exist`, `create_collection`, `delete_collection`.
  - Test `ChromaStore` methods: `get_collection`, `list_collection_names`, `create_collection`, `delete_collection`.

* **Data Operation Tests**
  - Test `ChromaCollection` methods: `_inner_upsert`, `_inner_get`, `_inner_delete`, `_inner_search`.

* **Filter Parsing Tests**
  - Test `_parse_filter` method in `ChromaCollection` with multiple filter types and varying number of filters.
  - Test `_parse_filter` method with no filters.
  - Test `_parse_filter` method with multiple filters.
@moonbox3 moonbox3 enabled auto-merge February 27, 2025 08:12
@moonbox3 moonbox3 added this pull request to the merge queue Feb 27, 2025
Merged via the queue into microsoft:main with commit 536edaa Feb 27, 2025
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
memory python Pull requests for the Python Semantic Kernel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python: Update Chroma Memory Connector to new Vector Search Design
5 participants