From 3a259e4d2fb90c3e9fbe5485560ee9a4f67409ad Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Wed, 15 Mar 2023 14:44:35 -0400 Subject: [PATCH 01/11] initial commit, Http version issues still needs to be resolved --- .../src/PartitionKeyBuilder.cs | 7 +--- .../src/Resource/Database/DatabaseCore.cs | 8 +--- .../Resource/Settings/ContainerProperties.cs | 23 +---------- .../CosmosContainerTests.cs | 7 +++- .../CosmosReadManyItemsTests.cs | 39 +------------------ 5 files changed, 11 insertions(+), 73 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/PartitionKeyBuilder.cs b/Microsoft.Azure.Cosmos/src/PartitionKeyBuilder.cs index 6154921a86..e9b0e70a7d 100644 --- a/Microsoft.Azure.Cosmos/src/PartitionKeyBuilder.cs +++ b/Microsoft.Azure.Cosmos/src/PartitionKeyBuilder.cs @@ -11,12 +11,7 @@ namespace Microsoft.Azure.Cosmos /// /// Represents a partition key value list in the Azure Cosmos DB service. /// -#if PREVIEW - public -#else - internal -#endif - sealed class PartitionKeyBuilder + public sealed class PartitionKeyBuilder { private readonly List partitionKeyValues; diff --git a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseCore.cs b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseCore.cs index f8bbb95276..5f97a15286 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseCore.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Database/DatabaseCore.cs @@ -5,6 +5,7 @@ namespace Microsoft.Azure.Cosmos { using System; + using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; @@ -15,10 +16,6 @@ namespace Microsoft.Azure.Cosmos using Microsoft.Azure.Cosmos.Tracing; using Microsoft.Azure.Documents; -#if PREVIEW - using System.Collections.Generic; -#endif - /// /// Operations for reading or deleting an existing database. /// @@ -219,7 +216,6 @@ public async Task CreateContainerIfNotExistsAsync( nameof(containerProperties.PartitionKey)); } } -#if PREVIEW else { IReadOnlyList retrivedPartitionKeyPaths = retrivedContainerResponse.Resource.PartitionKeyPaths; @@ -236,7 +232,7 @@ public async Task CreateContainerIfNotExistsAsync( nameof(containerProperties.PartitionKey)); } } -#endif + return retrivedContainerResponse; } } diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs index b95efb99c8..7e2d8bf719 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs @@ -113,13 +113,7 @@ public ContainerProperties(string id, string partitionKeyPath) /// /// The Id of the resource in the Azure Cosmos service. /// The path to the partition key. Example: /location -#if PREVIEW - public -#else - internal -#endif - - ContainerProperties(string id, IReadOnlyList partitionKeyPaths) + public ContainerProperties(string id, IReadOnlyList partitionKeyPaths) { this.Id = id; @@ -347,12 +341,6 @@ public string PartitionKeyPath { get { -#if PREVIEW - if (this.PartitionKey?.Kind == PartitionKind.MultiHash && this.PartitionKey?.Paths.Count > 1) - { - throw new NotImplementedException($"This MultiHash collection has more than 1 partition key path please use `PartitionKeyPaths`"); - } -#endif return this.PartitionKey?.Paths != null && this.PartitionKey.Paths.Count > 0 ? this.PartitionKey?.Paths[0] : null; } set @@ -380,12 +368,7 @@ public string PartitionKeyPath /// JSON path used for containers partitioning /// [JsonIgnore] -#if PREVIEW - public -#else - internal -#endif - IReadOnlyList PartitionKeyPaths + public IReadOnlyList PartitionKeyPaths { get => this.PartitionKey?.Paths; set @@ -657,12 +640,10 @@ internal IReadOnlyList> PartitionKeyPathTokens throw new ArgumentOutOfRangeException($"Container {this.Id} is not partitioned"); } -#if PREVIEW if (this.PartitionKey.Kind == Documents.PartitionKind.MultiHash && this.PartitionKeyPaths == null) { throw new ArgumentOutOfRangeException($"Container {this.Id} is not partitioned"); } -#endif List> partitionKeyPathTokensList = new List>(); foreach (string path in this.PartitionKey?.Paths) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs index 07cb6a4dca..a07c3715f4 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs @@ -11,6 +11,7 @@ namespace Microsoft.Azure.Cosmos.SDK.EmulatorTests using System.Linq; using System.Net; using System.Threading.Tasks; + using HttpConstants = Microsoft.Azure.Documents.HttpConstants; using Microsoft.Azure.Cosmos.Resource.CosmosExceptions; using Microsoft.Azure.Cosmos.Tracing; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -22,6 +23,8 @@ public class CosmosContainerTests { private CosmosClient cosmosClient = null; private Cosmos.Database cosmosDatabase = null; + + private readonly string currentVersion = HttpConstants.Versions.CurrentVersion; private static long ToEpoch(DateTime dateTime) { return (long)(dateTime - new DateTime(1970, 1, 1)).TotalSeconds; @@ -30,6 +33,7 @@ private static long ToEpoch(DateTime dateTime) [TestInitialize] public async Task TestInit() { + HttpConstants.Versions.CurrentVersion = "2020-07-15"; this.cosmosClient = TestCommon.CreateCosmosClient(); string databaseName = Guid.NewGuid().ToString(); @@ -49,6 +53,7 @@ public async Task TestCleanup() { await this.cosmosDatabase.DeleteStreamAsync(); } + HttpConstants.Versions.CurrentVersion = this.currentVersion; this.cosmosClient.Dispose(); } @@ -713,7 +718,6 @@ public async Task GetFeedRangeOnContainerRecreateScenariosTestAsync() } } -#if PREVIEW //MultiHash container checks. [TestMethod] public async Task CreateContainerIfNotExistsAsyncForMultiHashCollectionsTest() @@ -798,7 +802,6 @@ public async Task CreateContainerIfNotExistsAsyncForMultiHashCollectionsTest() } -#endif [TestMethod] public async Task StreamPartitionedCreateWithPathDelete() { diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs index c3949d763f..d215b6b18b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosReadManyItemsTests.cs @@ -510,44 +510,7 @@ await container.CreateItemAsync( await database.DeleteAsync(); client.Dispose(); - } - -#if PREVIEW - [TestMethod] - public async Task ReadManyMultiplePK() - { - IReadOnlyList pkPaths = new List { "/pk", "/description" }; - ContainerProperties containerSettings = new ContainerProperties(id: Guid.NewGuid().ToString(), partitionKeyPaths: pkPaths); - Container container = await this.database.CreateContainerAsync(containerSettings); - - for (int i = 0; i < 5; i++) - { - ToDoActivity item = ToDoActivity.CreateRandomToDoActivity(); - item.pk = "pk" + i.ToString(); - item.id = i.ToString(); - item.description = "description" + i; - ItemResponse itemResponse = await container.CreateItemAsync(item); - Assert.AreEqual(HttpStatusCode.Created, itemResponse.StatusCode); - } - - List<(string, PartitionKey)> itemList = new List<(string, PartitionKey)>(); - for (int i = 0; i < 5; i++) - { - PartitionKey partitionKey = new PartitionKeyBuilder() - .Add("pk" + i) - .Add("description" + i) - .Build(); - - itemList.Add((i.ToString(), partitionKey)); - } - - FeedResponse feedResponse = await container.ReadManyItemsAsync(itemList); - Assert.IsNotNull(feedResponse); - Assert.AreEqual(feedResponse.Count, 5); - Assert.IsTrue(feedResponse.Headers.RequestCharge > 0); - Assert.IsNotNull(feedResponse.Diagnostics); - } -#endif + } private class NestedToDoActivity { From 63bf67a280d3bf0fa34fe8e2e69a5d8baf1df20b Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Thu, 16 Mar 2023 10:00:38 -0400 Subject: [PATCH 02/11] updateContracts + update Http Version --- Microsoft.Azure.Cosmos/src/CosmosClient.cs | 5 +- ...BaselineTests.TestLiteralSerialization.xml | 2 +- ...rializerBaseline.TestMemberInitializer.xml | 48 ++++++++++++++ .../CosmosContainerTests.cs | 3 - .../CosmosMultiHashTest.cs | 7 --- .../Contracts/DotNetPreviewSDKAPI.json | 63 ------------------- .../Contracts/DotNetSDKAPI.json | 63 +++++++++++++++++++ 7 files changed, 113 insertions(+), 78 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml diff --git a/Microsoft.Azure.Cosmos/src/CosmosClient.cs b/Microsoft.Azure.Cosmos/src/CosmosClient.cs index e5ca2d8b53..d4fe7dcb9b 100644 --- a/Microsoft.Azure.Cosmos/src/CosmosClient.cs +++ b/Microsoft.Azure.Cosmos/src/CosmosClient.cs @@ -115,11 +115,8 @@ public class CosmosClient : IDisposable static CosmosClient() { -#if PREVIEW HttpConstants.Versions.CurrentVersion = HttpConstants.Versions.v2020_07_15; -#else - HttpConstants.Versions.CurrentVersion = HttpConstants.Versions.v2018_12_31; -#endif + HttpConstants.Versions.CurrentVersionUTF8 = Encoding.UTF8.GetBytes(HttpConstants.Versions.CurrentVersion); ServiceInteropWrapper.AssembliesExist = new Lazy(() => diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml index c4c2fb38dd..b72807f399 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml @@ -435,7 +435,7 @@ FROM root]]> diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml new file mode 100644 index 0000000000..8763ef6866 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml @@ -0,0 +1,48 @@ + + + + + (doc == new DataObject() {NumericField = 12, StringField = "12"}))]]> + + + + + + + + + new DataObject() {NumericField = 12, StringField = "12"})]]> + + + + + + + + + IIF((doc.NumericField > 12), new DataObject() {NumericField = 12, StringField = "12"}, new DataObject() {NumericField = 12, StringField = "12"}))]]> + + + 12) ? {"number": 12, "String_value": "12", "id": null, "Pk": null} : {"number": 12, "String_value": "12", "id": null, "Pk": null}) +FROM root]]> + + + + + + (doc == new DataObject() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]> + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs index a07c3715f4..f3befc588b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosContainerTests.cs @@ -24,7 +24,6 @@ public class CosmosContainerTests private CosmosClient cosmosClient = null; private Cosmos.Database cosmosDatabase = null; - private readonly string currentVersion = HttpConstants.Versions.CurrentVersion; private static long ToEpoch(DateTime dateTime) { return (long)(dateTime - new DateTime(1970, 1, 1)).TotalSeconds; @@ -33,7 +32,6 @@ private static long ToEpoch(DateTime dateTime) [TestInitialize] public async Task TestInit() { - HttpConstants.Versions.CurrentVersion = "2020-07-15"; this.cosmosClient = TestCommon.CreateCosmosClient(); string databaseName = Guid.NewGuid().ToString(); @@ -53,7 +51,6 @@ public async Task TestCleanup() { await this.cosmosDatabase.DeleteStreamAsync(); } - HttpConstants.Versions.CurrentVersion = this.currentVersion; this.cosmosClient.Dispose(); } diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs index 3c590092db..5307145dfc 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/CosmosMultiHashTest.cs @@ -18,13 +18,9 @@ public class CosmosMultiHashTest private Container container = null; private ContainerProperties containerProperties = null; - private readonly string currentVersion = HttpConstants.Versions.CurrentVersion; - - [TestInitialize] public async Task TestInitialize() { - HttpConstants.Versions.CurrentVersion = "2020-07-15"; this.client = TestCommon.CreateCosmosClient(true); this.database = await this.client.CreateDatabaseIfNotExistsAsync("mydb"); @@ -37,9 +33,6 @@ public async Task Cleanup() { await this.database.DeleteAsync(); this.client.Dispose(); - - HttpConstants.Versions.CurrentVersion = this.currentVersion; - this.client.Dispose(); } [TestMethod] diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json index 43801584fe..39ae1d2eca 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetPreviewSDKAPI.json @@ -284,32 +284,10 @@ "Attributes": [], "MethodInfo": "Microsoft.Azure.Cosmos.ChangeFeedPolicy get_ChangeFeedPolicy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, - "System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths()": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "System.Collections.Generic.IReadOnlyList`1[System.String] PartitionKeyPaths[Newtonsoft.Json.JsonIgnoreAttribute()]": { - "Type": "Property", - "Attributes": [ - "JsonIgnoreAttribute" - ], - "MethodInfo": "System.Collections.Generic.IReadOnlyList`1[System.String] PartitionKeyPaths;CanRead:True;CanWrite:True;System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String])": { - "Type": "Constructor", - "Attributes": [], - "MethodInfo": "[Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String]), Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String])]" - }, "Void set_ChangeFeedPolicy(Microsoft.Azure.Cosmos.ChangeFeedPolicy)": { "Type": "Method", "Attributes": [], "MethodInfo": "Void set_ChangeFeedPolicy(Microsoft.Azure.Cosmos.ChangeFeedPolicy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String])": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" } }, "NestedTypes": {} @@ -384,47 +362,6 @@ } }, "NestedTypes": {} - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder;System.Object;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { - "Subclasses": {}, - "Members": { - "Microsoft.Azure.Cosmos.PartitionKey Build()": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKey Build();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Boolean)": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Double)": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Double);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(System.String)": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNoneType()": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNoneType();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNullValue()": { - "Type": "Method", - "Attributes": [], - "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNullValue();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" - }, - "Void .ctor()": { - "Type": "Constructor", - "Attributes": [], - "MethodInfo": "[Void .ctor(), Void .ctor()]" - } - }, - "NestedTypes": {} } }, "Members": {}, diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json index 9edd8d6de1..3cf5c017c2 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json @@ -2167,6 +2167,18 @@ ], "MethodInfo": "Microsoft.Azure.Cosmos.UniqueKeyPolicy UniqueKeyPolicy;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.UniqueKeyPolicy get_UniqueKeyPolicy();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_UniqueKeyPolicy(Microsoft.Azure.Cosmos.UniqueKeyPolicy);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "System.Collections.Generic.IReadOnlyList`1[System.String] PartitionKeyPaths[Newtonsoft.Json.JsonIgnoreAttribute()]": { + "Type": "Property", + "Attributes": [ + "JsonIgnoreAttribute" + ], + "MethodInfo": "System.Collections.Generic.IReadOnlyList`1[System.String] PartitionKeyPaths;CanRead:True;CanWrite:True;System.Collections.Generic.IReadOnlyList`1[System.String] get_PartitionKeyPaths();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "System.Nullable`1[Microsoft.Azure.Cosmos.PartitionKeyDefinitionVersion] get_PartitionKeyDefinitionVersion()": { "Type": "Method", "Attributes": [], @@ -2294,6 +2306,11 @@ "Attributes": [], "MethodInfo": "[Void .ctor(), Void .ctor()]" }, + "Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String])": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String]), Void .ctor(System.String, System.Collections.Generic.IReadOnlyList`1[System.String])]" + }, "Void .ctor(System.String, System.String)": { "Type": "Constructor", "Attributes": [], @@ -2348,6 +2365,11 @@ "Attributes": [], "MethodInfo": "Void set_PartitionKeyPath(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" }, + "Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String])": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Void set_PartitionKeyPaths(System.Collections.Generic.IReadOnlyList`1[System.String]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, "Void set_TimeToLivePropertyPath(System.String)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": { "Type": "Method", "Attributes": [ @@ -5589,6 +5611,47 @@ }, "NestedTypes": {} }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder;System.Object;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:False;IsClass:True;IsValueType:False;IsNested:False;IsGenericType:False;IsSerializable:False": { + "Subclasses": {}, + "Members": { + "Microsoft.Azure.Cosmos.PartitionKey Build()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKey Build();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Boolean)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Boolean);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Double)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(Double);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(System.String)": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder Add(System.String);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNoneType()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNoneType();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNullValue()": { + "Type": "Method", + "Attributes": [], + "MethodInfo": "Microsoft.Azure.Cosmos.PartitionKeyBuilder AddNullValue();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;" + }, + "Void .ctor()": { + "Type": "Constructor", + "Attributes": [], + "MethodInfo": "[Void .ctor(), Void .ctor()]" + } + }, + "NestedTypes": {} + }, "Microsoft.Azure.Cosmos.PartitionKeyDefinitionVersion;System.Enum;IsAbstract:False;IsSealed:True;IsInterface:False;IsEnum:True;IsClass:False;IsValueType:True;IsNested:False;IsGenericType:False;IsSerializable:True": { "Subclasses": {}, "Members": { From b31f9f536af2ea81667467ad2793e9ddb026f6d4 Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Thu, 16 Mar 2023 12:40:05 -0400 Subject: [PATCH 03/11] updateded version in test --- .../Microsoft.Azure.Cosmos.Tests/Contracts/ContractTests.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractTests.cs b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractTests.cs index 9501dee4ce..a4d295a634 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractTests.cs +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/ContractTests.cs @@ -23,13 +23,9 @@ public void ApiVersionTest() } catch(ArgumentNullException) { } -#if PREVIEW + Assert.AreEqual(HttpConstants.Versions.v2020_07_15, HttpConstants.Versions.CurrentVersion); CollectionAssert.AreEqual(Encoding.UTF8.GetBytes(HttpConstants.Versions.v2020_07_15), HttpConstants.Versions.CurrentVersionUTF8); -#else - Assert.AreEqual(HttpConstants.Versions.v2018_12_31, HttpConstants.Versions.CurrentVersion); - CollectionAssert.AreEqual(Encoding.UTF8.GetBytes(HttpConstants.Versions.v2018_12_31), HttpConstants.Versions.CurrentVersionUTF8); -#endif ulong capabilitites = SDKSupportedCapabilitiesHelpers.GetSDKSupportedCapabilities(); Assert.AreEqual(capabilitites & (ulong)SDKSupportedCapabilities.PartitionMerge, (ulong)SDKSupportedCapabilities.PartitionMerge); From 57dbec5be87ae56602b3d330033c1a070ef0fabc Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Thu, 16 Mar 2023 15:11:37 -0400 Subject: [PATCH 04/11] update contracts --- .../EndToEndTraceWriterBaselineTests.ReadManyAsync.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 9a96ef9751..62dd181b7b 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -542,11 +542,11 @@ } ] }]]> - Operation.ReadManyItemsStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.ReadManyItemsStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. From fbf72dba210c12a9c4b1d69c8faa16a2c60a9551 Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Thu, 16 Mar 2023 17:54:43 -0400 Subject: [PATCH 05/11] requested changed --- .../src/Resource/Settings/ContainerProperties.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs index 7e2d8bf719..f70f0bc025 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs @@ -112,7 +112,7 @@ public ContainerProperties(string id, string partitionKeyPath) /// Initializes a new instance of the class for the Azure Cosmos DB service. /// /// The Id of the resource in the Azure Cosmos service. - /// The path to the partition key. Example: /location + /// The paths of a mulihashed partition key. Example: ["/state", "/city"] public ContainerProperties(string id, IReadOnlyList partitionKeyPaths) { this.Id = id; @@ -341,6 +341,11 @@ public string PartitionKeyPath { get { + if (this.PartitionKey?.Kind == PartitionKind.MultiHash && this.PartitionKey?.Paths.Count > 1) + { + throw new NotImplementedException($"This MultiHash collection has more than 1 partition key path please use `PartitionKeyPaths`"); + } + return this.PartitionKey?.Paths != null && this.PartitionKey.Paths.Count > 0 ? this.PartitionKey?.Paths[0] : null; } set @@ -365,7 +370,7 @@ public string PartitionKeyPath } /// - /// JSON path used for containers partitioning + /// List of JSON paths used for containers with subpartitioning /// [JsonIgnore] public IReadOnlyList PartitionKeyPaths From 4af081ffb751fd7ecc553d3f2586662b2bad7695 Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Fri, 17 Mar 2023 11:34:56 -0400 Subject: [PATCH 06/11] changed name in comments to subpartitioning from multihash --- .../src/Resource/Settings/ContainerProperties.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs index f70f0bc025..5b1287c752 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs @@ -112,7 +112,7 @@ public ContainerProperties(string id, string partitionKeyPath) /// Initializes a new instance of the class for the Azure Cosmos DB service. /// /// The Id of the resource in the Azure Cosmos service. - /// The paths of a mulihashed partition key. Example: ["/state", "/city"] + /// The paths of a subpartitioned partition keys. Example: ["/state", "/city"] public ContainerProperties(string id, IReadOnlyList partitionKeyPaths) { this.Id = id; From d5c05c84e62134a3e888eae6af54793ea16eaf65 Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Fri, 17 Mar 2023 13:27:40 -0700 Subject: [PATCH 07/11] undid changes to TestLiteralSerialization.xml --- .../LinqTranslationBaselineTests.TestLiteralSerialization.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml index b72807f399..c4c2fb38dd 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestLiteralSerialization.xml @@ -435,7 +435,7 @@ FROM root]]> From f765d8a12792e65343782c8271ce7d6a616f7824 Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Mon, 20 Mar 2023 09:40:51 -0400 Subject: [PATCH 08/11] removed changes to non API.json files --- ...TraceWriterBaselineTests.ReadManyAsync.xml | 4 +-- ...ionBaselineTests.TestMemberInitializer.xml | 25 ------------------- 2 files changed, 2 insertions(+), 27 deletions(-) delete mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestMemberInitializer.xml diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml index 62dd181b7b..9a96ef9751 100644 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/EndToEndTraceWriterBaselineTests.ReadManyAsync.xml @@ -542,11 +542,11 @@ } ] }]]> - Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US + Operation.ReadManyItemsStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US +Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US -Operation.ReadManyItemsStreamAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationReadManyItemsStreamAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeReaddb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US Operation.CreateItemAsynckindclientaz.namespaceMicrosoft.DocumentDBdb.operationCreateItemAsyncdb.namedb.cosmosdb.containerdb.systemcosmosdbdb.cosmosdb.machine_idnet.peer.name127.0.0.1db.cosmosdb.client_iddb.cosmosdb.user_agentdb.cosmosdb.connection_modeDirectdb.cosmosdb.operation_typeCreatedb.cosmosdb.request_content_length_bytesdb.cosmosdb.response_content_length_bytesdb.cosmosdb.status_codedb.cosmosdb.sub_status_codedb.cosmosdb.request_chargedb.cosmosdb.item_countdb.cosmosdb.activity_iddb.cosmosdb.correlated_activity_iddb.cosmosdb.regions_contactedSouth Central US LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. LatencyOverThresholdIdeally, this should contain request diagnostics but request diagnostics is subject to change with each request as it contains few unique id. So just putting this tag with this static text to make sure event is getting generated for each test. diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestMemberInitializer.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestMemberInitializer.xml deleted file mode 100644 index 7ebe4d4c35..0000000000 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestMemberInitializer.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - new DataObject() {NumericField = doc.NumericField, StringField = doc.StringField})]]> - - - - - - - - - (doc == new DataObject() {NumericField = doc.NumericField, StringField = doc.StringField}))]]> - - - - - - \ No newline at end of file From 94b2b08d0b71b38d3213e1e6f75024e30187541d Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Mon, 20 Mar 2023 09:52:32 -0400 Subject: [PATCH 09/11] removed non XXXAPI.json file changes --- ...ionBaselineTests.TestMemberInitializer.xml | 25 ++++++++++ ...rializerBaseline.TestMemberInitializer.xml | 48 ------------------- 2 files changed, 25 insertions(+), 48 deletions(-) create mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestMemberInitializer.xml delete mode 100644 Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestMemberInitializer.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestMemberInitializer.xml new file mode 100644 index 0000000000..7ebe4d4c35 --- /dev/null +++ b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationBaselineTests.TestMemberInitializer.xml @@ -0,0 +1,25 @@ + + + + + new DataObject() {NumericField = doc.NumericField, StringField = doc.StringField})]]> + + + + + + + + + (doc == new DataObject() {NumericField = doc.NumericField, StringField = doc.StringField}))]]> + + + + + + \ No newline at end of file diff --git a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml b/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml deleted file mode 100644 index 8763ef6866..0000000000 --- a/Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.EmulatorTests/BaselineTest/TestBaseline/LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - (doc == new DataObject() {NumericField = 12, StringField = "12"}))]]> - - - - - - - - - new DataObject() {NumericField = 12, StringField = "12"})]]> - - - - - - - - - IIF((doc.NumericField > 12), new DataObject() {NumericField = 12, StringField = "12"}, new DataObject() {NumericField = 12, StringField = "12"}))]]> - - - 12) ? {"number": 12, "String_value": "12", "id": null, "Pk": null} : {"number": 12, "String_value": "12", "id": null, "Pk": null}) -FROM root]]> - - - - - - (doc == new DataObject() {NumericField = doc.NumericField, StringField = doc.StringField})).Select(b => "A")]]> - - - - - - \ No newline at end of file From 2f75ebce64c38f7dc59a695c83753524a78f310b Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Mon, 20 Mar 2023 13:16:00 -0400 Subject: [PATCH 10/11] changed verbage on public comments --- .../src/Resource/Settings/ContainerProperties.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs index 5b1287c752..e3158afd82 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs @@ -112,7 +112,7 @@ public ContainerProperties(string id, string partitionKeyPath) /// Initializes a new instance of the class for the Azure Cosmos DB service. /// /// The Id of the resource in the Azure Cosmos service. - /// The paths of a subpartitioned partition keys. Example: ["/state", "/city"] + /// The paths of the hierarchical partition keys. Example: ["/tenantId", "/userId"] public ContainerProperties(string id, IReadOnlyList partitionKeyPaths) { this.Id = id; @@ -370,7 +370,7 @@ public string PartitionKeyPath } /// - /// List of JSON paths used for containers with subpartitioning + /// List of JSON paths used for containers with hierarchical partition keys /// [JsonIgnore] public IReadOnlyList PartitionKeyPaths From dea3489b971102011970e3f09ab858a62352b6a5 Mon Sep 17 00:00:00 2001 From: Nalu Tripician Date: Mon, 20 Mar 2023 13:27:50 -0400 Subject: [PATCH 11/11] changed error message to reflect verbage change --- .../src/Resource/Settings/ContainerProperties.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs index e3158afd82..94cb93cff5 100644 --- a/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs +++ b/Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs @@ -343,7 +343,7 @@ public string PartitionKeyPath { if (this.PartitionKey?.Kind == PartitionKind.MultiHash && this.PartitionKey?.Paths.Count > 1) { - throw new NotImplementedException($"This MultiHash collection has more than 1 partition key path please use `PartitionKeyPaths`"); + throw new NotImplementedException($"This subpartitioned container has more than 1 partition key path please use `PartitionKeyPaths`"); } return this.PartitionKey?.Paths != null && this.PartitionKey.Paths.Count > 0 ? this.PartitionKey?.Paths[0] : null;