Skip to content

Commit

Permalink
Release: Adds commits for 3.32.2-preview hotfix release (#3757)
Browse files Browse the repository at this point in the history
Cherry pick of commits into release branch
  • Loading branch information
ealsur authored Mar 13, 2023
1 parent 162aff8 commit 5ed6c8e
Show file tree
Hide file tree
Showing 15 changed files with 3,082 additions and 297 deletions.
6 changes: 3 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ClientOfficialVersion>3.32.1</ClientOfficialVersion>
<ClientPreviewVersion>3.32.1</ClientPreviewVersion>
<ClientOfficialVersion>3.32.2</ClientOfficialVersion>
<ClientPreviewVersion>3.32.2</ClientPreviewVersion>
<ClientPreviewSuffixVersion>preview</ClientPreviewSuffixVersion>
<DirectVersion>3.30.1</DirectVersion>
<DirectVersion>3.30.2</DirectVersion>
<EncryptionOfficialVersion>2.0.1</EncryptionOfficialVersion>
<EncryptionPreviewVersion>2.0.1</EncryptionPreviewVersion>
<EncryptionPreviewSuffixVersion>preview</EncryptionPreviewSuffixVersion>
Expand Down
1,531 changes: 1,531 additions & 0 deletions Microsoft.Azure.Cosmos/contracts/API_3.32.2-preview.txt

Large diffs are not rendered by default.

1,478 changes: 1,478 additions & 0 deletions Microsoft.Azure.Cosmos/contracts/API_3.32.2.txt

Large diffs are not rendered by default.

17 changes: 0 additions & 17 deletions Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Cosmos.Linq
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
Expand Down Expand Up @@ -713,22 +712,6 @@ public static SqlScalarExpression VisitConstant(ConstantExpression inputExpressi
return SqlArrayCreateScalarExpression.Create(arrayItems.ToImmutableArray());
}

if (context.linqSerializerOptions?.CustomCosmosSerializer != null)
{
StringWriter writer = new StringWriter(CultureInfo.InvariantCulture);

// Use the user serializer for the parameter values so custom conversions are correctly handled
using (Stream stream = context.linqSerializerOptions.CustomCosmosSerializer.ToStream(inputExpression.Value))
{
using (StreamReader streamReader = new StreamReader(stream))
{
string propertyValue = streamReader.ReadToEnd();
writer.Write(propertyValue);
return CosmosElement.Parse(writer.ToString()).Accept(CosmosElementToSqlScalarExpressionVisitor.Singleton);
}
}
}

return CosmosElement.Parse(JsonConvert.SerializeObject(inputExpression.Value)).Accept(CosmosElementToSqlScalarExpressionVisitor.Singleton);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,11 @@ public override IOrderedQueryable<T> GetItemLinqQueryable<T>(
{
requestOptions ??= new QueryRequestOptions();

if (linqSerializerOptions == null && this.ClientContext.ClientOptions != null)
if (linqSerializerOptions == null && this.ClientContext.ClientOptions.SerializerOptions != null)
{
linqSerializerOptions = new CosmosLinqSerializerOptions
{
PropertyNamingPolicy = this.ClientContext.ClientOptions.SerializerOptions != null
? this.ClientContext.ClientOptions.SerializerOptions.PropertyNamingPolicy
: CosmosPropertyNamingPolicy.Default,
CustomCosmosSerializer = this.ClientContext.ClientOptions.Serializer
PropertyNamingPolicy = this.ClientContext.ClientOptions.SerializerOptions.PropertyNamingPolicy
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ public CosmosLinqSerializerOptions()
this.PropertyNamingPolicy = CosmosPropertyNamingPolicy.Default;
}

/// <summary>
/// Gets or sets the user defined customer serializer. If no customer serializer was defined,
/// then the value is set to the default value
/// </summary>
/// <remarks>
/// The default value is null
/// </remarks>
internal CosmosSerializer CustomCosmosSerializer { get; set; }

/// <summary>
/// Gets or sets whether the naming policy used to convert a string-based name to another format,
/// such as a camel-casing format.
Expand Down
9 changes: 1 addition & 8 deletions Microsoft.Azure.Cosmos/src/ValidationHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ public static bool IsValidConsistencyLevelOverwrite(
{
if (isLocalQuorumConsistency &&
ValidationHelpers.IsLocalQuorumConsistency(
backendConsistency: backendConsistency,
desiredConsistency: desiredConsistency,
operationType: operationType,
resourceType: resourceType))
Expand Down Expand Up @@ -109,21 +108,15 @@ private static bool IsValidConsistencyLevelOverwrite(
/// <summary>
/// Condition to check Quorum(i.e. Strong) read with either an eventual consistency account or a consistent prefix account.
/// </summary>
/// <param name="backendConsistency"></param>
/// <param name="desiredConsistency"></param>
/// <param name="operationType"></param>
/// <param name="resourceType"></param>
/// <returns>true/false</returns>
private static bool IsLocalQuorumConsistency(Documents.ConsistencyLevel backendConsistency,
private static bool IsLocalQuorumConsistency(
Documents.ConsistencyLevel desiredConsistency,
OperationType? operationType,
ResourceType? resourceType)
{
if (backendConsistency != Documents.ConsistencyLevel.Eventual && backendConsistency != Documents.ConsistencyLevel.ConsistentPrefix)
{
return false;
}

if (desiredConsistency != Documents.ConsistencyLevel.Strong)
{
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ FROM root]]></SqlQuery>
</Input>
<Output>
<SqlQuery><![CDATA[
SELECT VALUE {}
SELECT VALUE {"value": null}
FROM root]]></SqlQuery>
</Output>
</Result>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@ Family createDataObj(Random random)
return getQuery;
}

public static Func<bool, IQueryable<Data>> GenerateSimpleCosmosData(Cosmos.Database cosmosDatabase)
public static Func<bool, IQueryable<Data>> GenerateSimpleCosmosData(
Cosmos.Database cosmosDatabase
)
{
const int DocumentCount = 10;
PartitionKeyDefinition partitionKeyDefinition = new PartitionKeyDefinition { Paths = new System.Collections.ObjectModel.Collection<string>(new[] { "/Pk" }), Kind = PartitionKind.Hash };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//-----------------------------------------------------------------------
// <copyright file="LinqTranslationBaselineTests.cs" company="Microsoft Corporation">
// <copyright file="LinqAttributeContractTests.cs" company="Microsoft Corporation">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
<None Remove="BaselineTest\TestBaseline\IndexMetricsParserBaselineTest.IndexUtilizationParse.xml" />
<None Remove="BaselineTest\TestBaseline\LinqTranslationBaselineTests.TestDateTimeJsonConverterTimezones.xml" />
<None Remove="BaselineTest\TestBaseline\LinqTranslationBaselineTests.TestMemberAccessWithNullableTypes.xml" />
<None Remove="BaselineTest\TestBaseline\LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -248,9 +247,6 @@
<Content Include="BaselineTest\TestBaseline\LinqTranslationBaselineTests.TestMemberAccess.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="BaselineTest\TestBaseline\LinqTranslationWithCustomSerializerBaseline.TestMemberInitializer.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Query\AggregateQueryTests.AggregateMixedTypes_baseline.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down
Loading

0 comments on commit 5ed6c8e

Please sign in to comment.