-
Notifications
You must be signed in to change notification settings - Fork 4.4k
.Net: Switch MEVD MongoDB Driver to v3.51 #13370
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
base: main
Are you sure you want to change the base?
Conversation
This means targetting .NET 4.7.2 for vector data implementations that depend on it. Supressed warnings about disposal since it doesn't do anything yet. # Conflicts: # dotnet/Directory.Packages.props
roji
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see this @damieng, thanks. All looks good, see mainly the question about netstandard2.1 and some nits.
roji
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, pinged others for a 2nd review necessary for merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A number of the conformance tests are failing for me, all with a similar error, e.g.
MongoRecordConformanceTests_Guid.GetAsync_WithVectors
Note that these tests have be enabled manually to be run by commenting out the following line in assembly info.
[assembly: DisableTests(Skip = "The MongoDB container is intermittently timing out at startup time blocking prs, so these test should be run manually.")]
Error:
Message:
MongoDB.Bson.BsonSerializationException : An error occurred while serializing the Id property of class VectorData.ConformanceTests.Models.SimpleRecord`1[[System.Guid, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]: GuidSerializer cannot serialize a Guid when GuidRepresentation is Unspecified.
---- MongoDB.Bson.BsonSerializationException : GuidSerializer cannot serialize a Guid when GuidRepresentation is Unspecified.
Stack Trace:
BsonClassMapSerializer1.SerializeMember(BsonSerializationContext context, Object obj, BsonMemberMap memberMap) BsonClassMapSerializer1.SerializeClass(BsonSerializationContext context, BsonSerializationArgs args, TClass document)
BsonClassMapSerializer1.Serialize(BsonSerializationContext context, BsonSerializationArgs args, TClass value) BsonExtensionMethods.ToBsonDocument(Object obj, Type nominalType, IBsonSerializer serializer, Action1 configurator, BsonSerializationArgs args)
BsonExtensionMethods.ToBsonDocument[TNominalType](TNominalType obj, IBsonSerializer1 serializer, Action1 configurator, BsonSerializationArgs args)
MongoMapper1.MapFromDataToStorageModel(TRecord dataModel, Int32 recordIndex, IReadOnlyList1[] generatedEmbeddings) line 53
MongoCollection2.UpsertCoreAsync(TRecord record, Int32 recordIndex, IReadOnlyList1[] generatedEmbeddings, CancellationToken cancellationToken) line 270
MongoCollection2.UpsertAsync(IEnumerable1 records, CancellationToken cancellationToken) line 261
VectorStoreCollectionFixture2.SeedAsync() line 52 VectorStoreCollectionFixture2.InitializeAsync() line 41
----- Inner Stack Trace -----
GuidSerializer.Serialize(BsonSerializationContext context, BsonSerializationArgs args, Guid value)
IBsonSerializer.Serialize(BsonSerializationContext context, BsonSerializationArgs args, Object value)
IBsonSerializerExtensions.Serialize(IBsonSerializer serializer, BsonSerializationContext context, Object value)
BsonClassMapSerializer1.SerializeNormalMember(BsonSerializationContext context, Object obj, BsonMemberMap memberMap) BsonClassMapSerializer1.SerializeMember(BsonSerializationContext context, Object obj, BsonMemberMap memberMap)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes made to MongoCollection would need to be applied to CosmosCollection. I don't have authorisation to work on that at my end nor access to a Cosmos instance/emulator to test it with. Sorry.
|
Great that this is being ported to the latest MDB driver 3.x. When could we expect a new build to be available? Thanks! |
Co-authored-by: westey <164392973+westey-m@users.noreply.github.com>
|
@damieng Can you take a look at the merge conflicts |
Head branch was pushed to by a user without write access
273ed76 to
8daf05a
Compare
Motivation and Context
Switches the MongoDB Driver to the latest 3.5 release which had a number of breaking changes.
This affects both the MongoDB vector data project and the CosmosMongoDB project.
This fixes #11652 and likely addresses #12707 and partly #10291.
Description
Switches the MongoDB driver to 3.5. Part of the breaking changes is that GUIDs in BSON no longer have a default storage format specified due to the need to switch from the C#-only format to the cross-MongoDB-driver standard format. Setting this is achieved in this PR by way of both a convention for the registry based mode and an alternative to BsonValue.Create in the scenarios where we don't have access to conventions/serialization such as key creation and using the dynamic mapper.
Contribution Checklist
cc @roji