Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Maya-Painter committed Nov 2, 2023
1 parent 2d13dfc commit 0e15171
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace Microsoft.Azure.Cosmos.Linq
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using Microsoft.Azure.Cosmos.CosmosElements;
using Microsoft.Azure.Cosmos.CosmosElements.Numbers;
using Microsoft.Azure.Cosmos.SqlObjects;
Expand Down Expand Up @@ -33,7 +34,8 @@ public SqlScalarExpression Visit(CosmosArray cosmosArray)
public SqlScalarExpression Visit(CosmosBinary cosmosBinary)
{
// Can not convert binary to scalar expression without knowing the API type.
throw new NotImplementedException();
Debug.Fail("CosmosElementToSqlScalarExpressionVisitor Assert", "Unreachable");
throw new InvalidOperationException();
}

public SqlScalarExpression Visit(CosmosBoolean cosmosBoolean)
Expand All @@ -44,7 +46,8 @@ public SqlScalarExpression Visit(CosmosBoolean cosmosBoolean)
public SqlScalarExpression Visit(CosmosGuid cosmosGuid)
{
// Can not convert guid to scalar expression without knowing the API type.
throw new NotImplementedException();
Debug.Fail("CosmosElementToSqlScalarExpressionVisitor Assert", "Unreachable");
throw new InvalidOperationException();
}

public SqlScalarExpression Visit(CosmosNull cosmosNull)
Expand Down
5 changes: 2 additions & 3 deletions Microsoft.Azure.Cosmos/src/Linq/ExpressionToSQL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ private static SqlScalarExpression VisitScalarExpression(Expression expression,

ParameterExpression parameterExpression = context.GenFreshParameter(typeof(object), ExpressionToSql.DefaultParameterName);
SqlCollection subqueryCollection = ExpressionToSql.CreateSubquerySqlCollection(
query, context,
query,
isMinMaxAvgMethod ? SubqueryKind.ArrayScalarExpression : expressionObjKind.Value);

Binding newBinding = new Binding(parameterExpression, subqueryCollection,
Expand All @@ -1383,9 +1383,8 @@ private static SqlScalarExpression VisitScalarExpression(Expression expression,
/// Create a subquery SQL collection object for a SQL query
/// </summary>
/// <param name="query">The SQL query object</param>
/// <param name="context">The translation context</param>
/// <param name="subqueryType">The subquery type</param>
private static SqlCollection CreateSubquerySqlCollection(SqlQuery query, TranslationContext context, SubqueryKind subqueryType)
private static SqlCollection CreateSubquerySqlCollection(SqlQuery query, SubqueryKind subqueryType)
{
SqlCollection subqueryCollection;
switch (subqueryType)
Expand Down
2 changes: 1 addition & 1 deletion Microsoft.Azure.Cosmos/src/Linq/ICosmosLinqSerializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal interface ICosmosLinqSerializer
SqlScalarExpression ConvertToSqlScalarExpression(ConstantExpression inputExpression, IDictionary<object, string> parameters);

/// <summary>
/// Gets a member name with any LINQ serializer options applied.
/// Gets a member name with LINQ serializer options applied.
/// </summary>
string GetMemberName(MemberInfo memberInfo, CosmosLinqSerializerOptions linqSerializerOptions = null);
}
Expand Down

0 comments on commit 0e15171

Please sign in to comment.