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

.Net: Fixed record mapping in Azure CosmosDB MongoDB connector #8823

Merged
merged 6 commits into from
Sep 17, 2024

Conversation

dmytrostruk
Copy link
Member

Motivation and Context

Closes: #8694

Previous version of record mapping relied on AzureCosmosDBMongoDBNamingConvention class which was applied globally. This approach introduced some issues in unit tests in CI pipeline, like here: https://github.com/microsoft/semantic-kernel/actions/runs/10828226455/job/30043117037?pr=8693, although it's not possible to reproduce it locally. It looks like global naming policy registration sometimes is delayed or ignored, which causes tests to fail occasionally.

To avoid this transient issue, the logic of record mapping was updated to rely only on record property name or BsonElement name and use native BSON {de}serialization logic without global naming policies. Additional logic was added to handle key mapping, since key in MongoDB has a constant name _id, so it should be handled differently comparing to other fields.

Description

Contribution Checklist

@dmytrostruk dmytrostruk self-assigned this Sep 16, 2024
@dmytrostruk dmytrostruk requested a review from a team as a code owner September 16, 2024 20:19
@markwallace-microsoft markwallace-microsoft added .NET Issue or Pull requests regarding .NET code kernel Issues or pull requests impacting the core kernel memory labels Sep 16, 2024
@dmytrostruk dmytrostruk added this pull request to the merge queue Sep 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 17, 2024
@dmytrostruk dmytrostruk added this pull request to the merge queue Sep 17, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 17, 2024
@dmytrostruk dmytrostruk added this pull request to the merge queue Sep 17, 2024
Merged via the queue into microsoft:main with commit d5fa9cf Sep 17, 2024
15 checks passed
@dmytrostruk dmytrostruk deleted the fix-mapping-cosmos-mongodb branch September 17, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kernel Issues or pull requests impacting the core kernel memory .NET Issue or Pull requests regarding .NET code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.Net: Bug: AzureCosmosDBMongoDBVectorStoreRecordMapperTests unit tests are failing for PR builds
3 participants