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 AzureCosmosDBforMongoDB store and collection #10609

Merged
merged 14 commits into from
Feb 24, 2025

Conversation

eavanvalkenburg
Copy link
Member

@eavanvalkenburg eavanvalkenburg commented Feb 19, 2025

Motivation and Context

Adds Azure Cosmos DB for MongoDB support using the new vector store model.
Builds on the MongoDB Atlas integration, replaced the index creation and settings to make it work.

Closes #6836

Description

Contribution Checklist

@eavanvalkenburg eavanvalkenburg requested a review from a team as a code owner February 19, 2025 10:08
@eavanvalkenburg eavanvalkenburg added python Pull requests for the Python Semantic Kernel memory labels Feb 19, 2025
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 6 out of 10 changed files in this pull request and generated 1 comment.

Files not reviewed (4)
  • python/tests/unit/connectors/memory/mongodb_atlas/test_mongodb_atlas_collection.py: Evaluated as low risk
  • python/semantic_kernel/connectors/memory/azure_cosmos_db/const.py: Evaluated as low risk
  • python/samples/concepts/memory/new_memory.py: Evaluated as low risk
  • python/semantic_kernel/connectors/memory/azure_cosmos_db/init.py: Evaluated as low risk
Comments suppressed due to low confidence (3)

python/semantic_kernel/connectors/memory/azure_cosmos_db/azure_cosmos_db_mongodb_store.py:8

  • The override decorator is imported but not used in the file. Remove the unused import statement.
from typing import override  # pragma: no cover

python/semantic_kernel/connectors/memory/mongodb_atlas/mongodb_atlas_collection.py:169

  • [nitpick] The log message could be more descriptive. Consider changing it to 'Upserted records: %s' % result.
logger.debug("Upserted records:", result)

python/semantic_kernel/connectors/memory/mongodb_atlas/mongodb_atlas_collection.py:170

  • Add a check for 'result.upserted_ids' before iterating over it to avoid potential errors.
return [str(value) for key, value in result.upserted_ids.items()]

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 6 out of 10 changed files in this pull request and generated 1 comment.

Files not reviewed (4)
  • python/tests/unit/connectors/memory/mongodb_atlas/test_mongodb_atlas_collection.py: Evaluated as low risk
  • python/samples/concepts/memory/new_memory.py: Evaluated as low risk
  • python/semantic_kernel/connectors/memory/azure_cosmos_db/const.py: Evaluated as low risk
  • python/semantic_kernel/connectors/memory/azure_cosmos_db/init.py: Evaluated as low risk
Comments suppressed due to low confidence (1)

python/semantic_kernel/connectors/memory/mongodb_atlas/mongodb_atlas_store.py:72

  • [nitpick] The logic for setting 'managed_client' in the constructor is inconsistent with the logic used in 'AzureCosmosDBforMongoDBCollection'. Consider updating for consistency.
managed_client = kwargs.get("managed_client", not mongo_client)

Copy link
Contributor

@TaoChenOSU TaoChenOSU left a comment

Choose a reason for hiding this comment

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

Will there be unit and integration tests for the new connector in a separate PR?

@eavanvalkenburg eavanvalkenburg added this pull request to the merge queue Feb 24, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 24, 2025
@moonbox3 moonbox3 added this pull request to the merge queue Feb 24, 2025
Merged via the queue into microsoft:main with commit 534d860 Feb 24, 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 Azure ComsoDB for MongoDB Memory Connector to new Vector Search Design
3 participants