From 4bd6cb3a5c19ecdb71657bb9f2a3af9006220c31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:26:36 -0800 Subject: [PATCH] .Net: Bump Microsoft.Azure.Cosmos from 3.44.0-preview.1 to 3.45.2 in /dotnet (#9678) Due to the drop of float16 support in the package, additional change to drop from the connector was needed to comply with the latest breaking change. - https://github.com/Azure/azure-cosmos-dotnet-v3/pull/4792 Bumps [Microsoft.Azure.Cosmos](https://github.com/Azure/azure-cosmos-dotnet-v3) from 3.44.0-preview.1 to 3.45.2.
Release notes

Sourced from Microsoft.Azure.Cosmos's releases.

3.45.1

3.45.1 - 2024-11-11

Added

3.45.0

3.45.0 - 2024-10-25

Added

Fixed

3.45.0-preview.1

3.45.0-preview.1 - 2024-10-16

Fixed

3.45.0-preview.0

3.45.0-preview.0 - 2024-10-07

Added

3.44.1

3.44.1 - 2024-10-16

Fixed

... (truncated)

Changelog

Sourced from Microsoft.Azure.Cosmos's changelog.

3.45.2 - 2024-11-12

Added

3.46.0-preview.1 - 2024-11-06

3.45.1 - 2024-11-06

Added

3.46.0-preview.0 - 2024-10-25

Added

3.45.0 - 2024-10-25

Added

Fixed

3.45.0-preview.1 - 2024-10-07

3.44.1 - 2024-10-16

... (truncated)

Commits

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Microsoft.Azure.Cosmos&package-manager=nuget&previous-version=3.44.0-preview.1&new-version=3.45.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
--------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Roger Barreto <19890735+RogerBarreto@users.noreply.github.com> --- dotnet/Directory.Packages.props | 2 +- ...eCosmosDBNoSQLVectorStoreRecordCollectionTests.cs | 12 ------------ .../AzureCosmosDBNoSQLMemoryStore.cs | 6 +++--- .../AzureCosmosDBNoSQLVectorStoreRecordCollection.cs | 10 +--------- 4 files changed, 5 insertions(+), 25 deletions(-) diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props index 465355394d67..5664a440ce2b 100644 --- a/dotnet/Directory.Packages.props +++ b/dotnet/Directory.Packages.props @@ -114,7 +114,7 @@ - + diff --git a/dotnet/src/Connectors/Connectors.AzureCosmosDBNoSQL.UnitTests/AzureCosmosDBNoSQLVectorStoreRecordCollectionTests.cs b/dotnet/src/Connectors/Connectors.AzureCosmosDBNoSQL.UnitTests/AzureCosmosDBNoSQLVectorStoreRecordCollectionTests.cs index fc78fb74c244..d8718eb2f2b5 100644 --- a/dotnet/src/Connectors/Connectors.AzureCosmosDBNoSQL.UnitTests/AzureCosmosDBNoSQLVectorStoreRecordCollectionTests.cs +++ b/dotnet/src/Connectors/Connectors.AzureCosmosDBNoSQL.UnitTests/AzureCosmosDBNoSQLVectorStoreRecordCollectionTests.cs @@ -123,13 +123,6 @@ public async Task CreateCollectionUsesValidContainerPropertiesAsync(IndexingMode var expectedVectorEmbeddingPolicy = new VectorEmbeddingPolicy( [ - new Embedding - { - DataType = VectorDataType.Float16, - Dimensions = 1, - DistanceFunction = Microsoft.Azure.Cosmos.DistanceFunction.Cosine, - Path = "/DescriptionEmbedding1" - }, new Embedding { DataType = VectorDataType.Float32, @@ -157,7 +150,6 @@ public async Task CreateCollectionUsesValidContainerPropertiesAsync(IndexingMode { VectorIndexes = [ - new VectorIndexPath { Type = VectorIndexType.Flat, Path = "/DescriptionEmbedding1" }, new VectorIndexPath { Type = VectorIndexType.Flat, Path = "/DescriptionEmbedding2" }, new VectorIndexPath { Type = VectorIndexType.QuantizedFlat, Path = "/DescriptionEmbedding3" }, new VectorIndexPath { Type = VectorIndexType.DiskANN, Path = "/DescriptionEmbedding4" }, @@ -172,7 +164,6 @@ public async Task CreateCollectionUsesValidContainerPropertiesAsync(IndexingMode expectedIndexingPolicy.IncludedPaths.Add(new IncludedPath { Path = "/IndexableData2/?" }); expectedIndexingPolicy.IncludedPaths.Add(new IncludedPath { Path = "/" }); - expectedIndexingPolicy.ExcludedPaths.Add(new ExcludedPath { Path = "/DescriptionEmbedding1/*" }); expectedIndexingPolicy.ExcludedPaths.Add(new ExcludedPath { Path = "/DescriptionEmbedding2/*" }); expectedIndexingPolicy.ExcludedPaths.Add(new ExcludedPath { Path = "/DescriptionEmbedding3/*" }); expectedIndexingPolicy.ExcludedPaths.Add(new ExcludedPath { Path = "/DescriptionEmbedding4/*" }); @@ -704,9 +695,6 @@ private sealed class TestIndexingModel [VectorStoreRecordKey] public string? Id { get; set; } - [VectorStoreRecordVector(Dimensions: 1, DistanceFunction: DistanceFunction.CosineSimilarity, IndexKind: IndexKind.Flat)] - public ReadOnlyMemory? DescriptionEmbedding1 { get; set; } - [VectorStoreRecordVector(Dimensions: 2, DistanceFunction: DistanceFunction.CosineSimilarity, IndexKind: IndexKind.Flat)] public ReadOnlyMemory? DescriptionEmbedding2 { get; set; } diff --git a/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLMemoryStore.cs b/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLMemoryStore.cs index f89481ed107b..ab898fad6c13 100644 --- a/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLMemoryStore.cs +++ b/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLMemoryStore.cs @@ -63,7 +63,7 @@ public AzureCosmosDBNoSQLMemoryStore( new Embedding { DataType = vectorDataType, - Dimensions = dimensions, + Dimensions = (int)dimensions, DistanceFunction = DistanceFunction.Cosine, Path = EmbeddingPath, } @@ -141,10 +141,10 @@ contain an embedding path at {EmbeddingPath}. It's also recommended to include t be specified as {nameof(DistanceFunction)}.{nameof(DistanceFunction.Cosine)}. """); } - else if (embedding.DataType != VectorDataType.Float16 && embedding.DataType != VectorDataType.Float32) + else if (embedding.DataType != VectorDataType.Float32) { throw new NotSupportedException($""" - Only {nameof(VectorDataType)}.{nameof(VectorDataType.Float16)} and {nameof(VectorDataType)}.{nameof(VectorDataType.Float32)} + Only {nameof(VectorDataType)}.{nameof(VectorDataType.Float32)} are supported. """); } diff --git a/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLVectorStoreRecordCollection.cs index e458713bfff3..ba993c758dc8 100644 --- a/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLVectorStoreRecordCollection.cs @@ -57,11 +57,6 @@ public sealed class AzureCosmosDBNoSQLVectorStoreRecordCollection : /// A of types that vector properties on the provided model may have, based on enumeration. private static readonly HashSet s_supportedVectorTypes = [ - // Float16 -#if NET5_0_OR_GREATER - typeof(ReadOnlyMemory), - typeof(ReadOnlyMemory?), -#endif // Float32 typeof(ReadOnlyMemory), typeof(ReadOnlyMemory?), @@ -485,7 +480,7 @@ private ContainerProperties GetContainerProperties() var embedding = new Embedding { DataType = GetDataType(property.PropertyType, vectorPropertyName), - Dimensions = (ulong)property.Dimensions, + Dimensions = (int)property.Dimensions, DistanceFunction = GetDistanceFunction(property.DistanceFunction, vectorPropertyName), Path = path }; @@ -576,9 +571,6 @@ private static VectorDataType GetDataType(Type vectorDataType, string vectorProp { return vectorDataType switch { -#if NET5_0_OR_GREATER - Type type when type == typeof(ReadOnlyMemory) || type == typeof(ReadOnlyMemory?) => VectorDataType.Float16, -#endif Type type when type == typeof(ReadOnlyMemory) || type == typeof(ReadOnlyMemory?) => VectorDataType.Float32, Type type when type == typeof(ReadOnlyMemory) || type == typeof(ReadOnlyMemory?) => VectorDataType.Uint8, Type type when type == typeof(ReadOnlyMemory) || type == typeof(ReadOnlyMemory?) => VectorDataType.Int8,