Skip to content

Commit 216a0cf

Browse files
committed
Updating Cosmos version, including using new public APIs (#35074)
Replaces #35002
1 parent bd7d0aa commit 216a0cf

File tree

10 files changed

+7
-164
lines changed

10 files changed

+7
-164
lines changed

Directory.Packages.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<PackageVersion Include="Microsoft.DotNet.Build.Tasks.Templating" Version="$(MicrosoftDotNetBuildTasksTemplatingVersion)" />
3737

3838
<!-- Azure SDK for .NET dependencies -->
39-
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.43.0" />
39+
<PackageVersion Include="Microsoft.Azure.Cosmos" Version="3.45.2" />
4040

4141
<!-- SQL Server dependencies -->
4242
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.6" />
@@ -51,14 +51,14 @@
5151
<PackageVersion Include="NetTopologySuite.IO.SqlServerBytes" Version="2.1.0" />
5252
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
5353
<PackageVersion Include="mod_spatialite" Version="4.3.0.1" />
54-
<PackageVersion Include="SQLitePCLRaw.core" Version="$(SQLitePCLRawVersion)" />
54+
<PackageVersion Include="SQLitePCLRaw.core" Version="$(SQLitePCLRawVersion)" />
5555
<PackageVersion Include="SQLitePCLRaw.bundle_sqlite3" Version="$(SQLitePCLRawVersion)" />
5656
<PackageVersion Include="SQLitePCLRaw.bundle_e_sqlite3" Version="$(SQLitePCLRawVersion)" />
5757

5858
<!-- Pinned versions for Component Governance/NuGetAudit - Remove when root dependencies are updated -->
5959
<!--Workaround for Microsoft.CodeAnalysis.Workspaces.MSBuild 4.8.0, see https://github.com/dotnet/efcore/issues/34637-->
60-
<PackageVersion Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" />
61-
<!--Workaround for Microsoft.Data.SqlClient v5.1.6 and Microsoft.CodeAnalysis.Analyzer.Testing v1.1.2-->
60+
<PackageVersion Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkVersion)" />
61+
<!--Workaround for Microsoft.Data.SqlClient v5.1.6 and Microsoft.CodeAnalysis.Analyzer.Testing v1.1.2-->
6262
<PackageVersion Include="System.Formats.Asn1" Version="$(SystemFormatsAsn1Version)" />
6363
</ItemGroup>
6464
</Project>

src/EFCore.Cosmos/Extensions/DistanceFunction.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

src/EFCore.Cosmos/Extensions/Embedding.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/EFCore.Cosmos/Extensions/VectorDataType.cs

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/EFCore.Cosmos/Extensions/VectorIndexPath.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/EFCore.Cosmos/Extensions/VectorIndexType.cs

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/EFCore.Cosmos/Properties/CosmosStrings.Designer.cs

Lines changed: 0 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/EFCore.Cosmos/Properties/CosmosStrings.resx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,6 @@
271271
<data name="NoSubqueryPushdown" xml:space="preserve">
272272
<value>Azure Cosmos DB does not have an appropriate subquery for this translation.</value>
273273
</data>
274-
<data name="NoVectorContainerConfig" xml:space="preserve">
275-
<value>Container configuration for embeddings is not yet supported by the Cosmos SDK. Instead, configure the container manually. See https://aka.ms/ef-cosmos-vectors for more information.</value>
276-
</data>
277274
<data name="NullTypeMappingInSqlTree" xml:space="preserve">
278275
<value>The expression '{sqlExpression}' in the SQL tree does not have a type mapping assigned.</value>
279276
</data>

src/EFCore.Cosmos/Storage/Internal/CosmosClientWrapper.cs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,17 +272,14 @@ private static async Task<bool> CreateContainerIfNotExistsOnceAsync(
272272
AnalyticalStoreTimeToLiveInSeconds = parameters.AnalyticalStoreTimeToLiveInSeconds,
273273
};
274274

275-
// TODO: Enable these once they are available in the Cosmos SDK. See #33783.
276275
if (embeddings.Any())
277276
{
278-
throw new InvalidOperationException(CosmosStrings.NoVectorContainerConfig);
279-
//containerProperties.VectorEmbeddingPolicy = new VectorEmbeddingPolicy(embeddings);
277+
containerProperties.VectorEmbeddingPolicy = new VectorEmbeddingPolicy(embeddings);
280278
}
281279

282280
if (vectorIndexes.Any())
283281
{
284-
throw new InvalidOperationException(CosmosStrings.NoVectorContainerConfig);
285-
//containerProperties.IndexingPolicy = new IndexingPolicy { VectorIndexes = vectorIndexes };
282+
containerProperties.IndexingPolicy = new IndexingPolicy { VectorIndexes = vectorIndexes };
286283
}
287284

288285
var response = await wrapper.Client.GetDatabase(wrapper._databaseId).CreateContainerIfNotExistsAsync(

test/EFCore.Cosmos.FunctionalTests/VectorSearchCosmosTest.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ namespace Microsoft.EntityFrameworkCore;
99

1010
#pragma warning disable EF9103
1111

12-
// These tests are skipped for now because we cannot create a compatible test container until the SDK supports it.
13-
internal class VectorSearchCosmosTest : IClassFixture<VectorSearchCosmosTest.VectorSearchFixture>
12+
public class VectorSearchCosmosTest : IClassFixture<VectorSearchCosmosTest.VectorSearchFixture>
1413
{
1514
public VectorSearchCosmosTest(VectorSearchFixture fixture, ITestOutputHelper testOutputHelper)
1615
{

0 commit comments

Comments
 (0)