Skip to content

Commit 74a59ac

Browse files
committed
initialize QueryTextNode
1 parent 78bd8eb commit 74a59ac

File tree

4 files changed

+34
-35
lines changed

4 files changed

+34
-35
lines changed

Microsoft.Azure.Cosmos/src/RequestOptions/ChangeFeedRequestOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ internal override void PopulateRequestOptions(RequestMessage request)
8484
/// Users have the option to enable printing parameterized or all queries,
8585
/// but has to beware that customer data may be shown when the later option is chosen. It's the user's responsibility to sanitize the queries if necessary.
8686
/// </summary>
87-
internal QueryTextMode? QueryTextMode { get; set; }
87+
internal QueryTextMode QueryTextMode { get; set; } = Cosmos.QueryTextMode.None;
8888

8989
internal ChangeFeedRequestOptions Clone()
9090
{

Microsoft.Azure.Cosmos/src/RequestOptions/QueryRequestOptions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public ConsistencyLevel? ConsistencyLevel
176176
/// Users have the option to enable printing parameterized or all queries,
177177
/// but has to beware that customer data may be shown when the later option is chosen. It's the user's responsibility to sanitize the queries if necessary.
178178
/// </summary>
179-
public QueryTextMode? QueryTextMode { get; set; } = null;
179+
public QueryTextMode QueryTextMode { get; set; } = QueryTextMode.None;
180180

181181
internal CosmosElement CosmosElementContinuationToken { get; set; }
182182

Microsoft.Azure.Cosmos/src/Telemetry/OpenTelemetry/OpenTelemetryRecorderFactory.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,13 @@ public static OpenTelemetryCoreRecorder CreateRecorder(Func<string> getOperation
9090
private static QueryTextMode GetQueryTextMode(RequestOptions requestOptions, CosmosClientContext clientContext)
9191
{
9292
QueryTextMode? queryTextMode = null;
93-
if (requestOptions is QueryRequestOptions queryRequestOptions && queryRequestOptions.QueryTextMode.HasValue)
93+
if (requestOptions is QueryRequestOptions queryRequestOptions)
9494
{
95-
queryTextMode = queryRequestOptions.QueryTextMode.Value;
95+
queryTextMode = queryRequestOptions.QueryTextMode;
9696
}
97-
else if (requestOptions is ChangeFeedRequestOptions changeFeedRequestOptions && changeFeedRequestOptions.QueryTextMode.HasValue)
97+
else if (requestOptions is ChangeFeedRequestOptions changeFeedRequestOptions)
9898
{
99-
queryTextMode = changeFeedRequestOptions.QueryTextMode.Value;
100-
99+
queryTextMode = changeFeedRequestOptions.QueryTextMode;
101100
}
102101

103102
queryTextMode ??= clientContext.ClientOptions?.CosmosClientTelemetryOptions?.QueryTextMode ?? QueryTextMode.None;

Microsoft.Azure.Cosmos/tests/Microsoft.Azure.Cosmos.Tests/Contracts/DotNetSDKAPI.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6668,6 +6668,18 @@
66686668
],
66696669
"MethodInfo": "Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions get_DedicatedGatewayRequestOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
66706670
},
6671+
"Microsoft.Azure.Cosmos.QueryTextMode get_QueryTextMode()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
6672+
"Type": "Method",
6673+
"Attributes": [
6674+
"CompilerGeneratedAttribute"
6675+
],
6676+
"MethodInfo": "Microsoft.Azure.Cosmos.QueryTextMode get_QueryTextMode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
6677+
},
6678+
"Microsoft.Azure.Cosmos.QueryTextMode QueryTextMode": {
6679+
"Type": "Property",
6680+
"Attributes": [],
6681+
"MethodInfo": "Microsoft.Azure.Cosmos.QueryTextMode QueryTextMode;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.QueryTextMode get_QueryTextMode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_QueryTextMode(Microsoft.Azure.Cosmos.QueryTextMode);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
6682+
},
66716683
"System.Nullable`1[Microsoft.Azure.Cosmos.ConsistencyLevel] ConsistencyLevel": {
66726684
"Type": "Property",
66736685
"Attributes": [],
@@ -6690,18 +6702,6 @@
66906702
"Attributes": [],
66916703
"MethodInfo": "System.Nullable`1[Microsoft.Azure.Cosmos.PartitionKey] PartitionKey;CanRead:True;CanWrite:True;System.Nullable`1[Microsoft.Azure.Cosmos.PartitionKey] get_PartitionKey();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PartitionKey(System.Nullable`1[Microsoft.Azure.Cosmos.PartitionKey]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
66926704
},
6693-
"System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode] get_QueryTextMode()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
6694-
"Type": "Method",
6695-
"Attributes": [
6696-
"CompilerGeneratedAttribute"
6697-
],
6698-
"MethodInfo": "System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode] get_QueryTextMode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
6699-
},
6700-
"System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode] QueryTextMode": {
6701-
"Type": "Property",
6702-
"Attributes": [],
6703-
"MethodInfo": "System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode] QueryTextMode;CanRead:True;CanWrite:True;System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode] get_QueryTextMode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_QueryTextMode(System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
6704-
},
67056705
"System.Nullable`1[System.Boolean] EnableLowPrecisionOrderBy": {
67066706
"Type": "Property",
67076707
"Attributes": [],
@@ -6871,12 +6871,12 @@
68716871
],
68726872
"MethodInfo": "Void set_PopulateIndexMetrics(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
68736873
},
6874-
"Void set_QueryTextMode(System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
6874+
"Void set_QueryTextMode(Microsoft.Azure.Cosmos.QueryTextMode)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
68756875
"Type": "Method",
68766876
"Attributes": [
68776877
"CompilerGeneratedAttribute"
68786878
],
6879-
"MethodInfo": "Void set_QueryTextMode(System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
6879+
"MethodInfo": "Void set_QueryTextMode(Microsoft.Azure.Cosmos.QueryTextMode);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
68806880
},
68816881
"Void set_ResponseContinuationTokenLimitInKb(System.Nullable`1[System.Int32])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
68826882
"Type": "Method",
@@ -7789,6 +7789,18 @@
77897789
],
77907790
"MethodInfo": "Microsoft.Azure.Cosmos.DedicatedGatewayRequestOptions get_DedicatedGatewayRequestOptions();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
77917791
},
7792+
"Microsoft.Azure.Cosmos.QueryTextMode get_QueryTextMode()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
7793+
"Type": "Method",
7794+
"Attributes": [
7795+
"CompilerGeneratedAttribute"
7796+
],
7797+
"MethodInfo": "Microsoft.Azure.Cosmos.QueryTextMode get_QueryTextMode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
7798+
},
7799+
"Microsoft.Azure.Cosmos.QueryTextMode QueryTextMode": {
7800+
"Type": "Property",
7801+
"Attributes": [],
7802+
"MethodInfo": "Microsoft.Azure.Cosmos.QueryTextMode QueryTextMode;CanRead:True;CanWrite:True;Microsoft.Azure.Cosmos.QueryTextMode get_QueryTextMode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_QueryTextMode(Microsoft.Azure.Cosmos.QueryTextMode);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
7803+
},
77927804
"System.Nullable`1[Microsoft.Azure.Cosmos.ConsistencyLevel] ConsistencyLevel": {
77937805
"Type": "Property",
77947806
"Attributes": [],
@@ -7811,18 +7823,6 @@
78117823
"Attributes": [],
78127824
"MethodInfo": "System.Nullable`1[Microsoft.Azure.Cosmos.PartitionKey] PartitionKey;CanRead:True;CanWrite:True;System.Nullable`1[Microsoft.Azure.Cosmos.PartitionKey] get_PartitionKey();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_PartitionKey(System.Nullable`1[Microsoft.Azure.Cosmos.PartitionKey]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
78137825
},
7814-
"System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode] get_QueryTextMode()[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
7815-
"Type": "Method",
7816-
"Attributes": [
7817-
"CompilerGeneratedAttribute"
7818-
],
7819-
"MethodInfo": "System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode] get_QueryTextMode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
7820-
},
7821-
"System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode] QueryTextMode": {
7822-
"Type": "Property",
7823-
"Attributes": [],
7824-
"MethodInfo": "System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode] QueryTextMode;CanRead:True;CanWrite:True;System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode] get_QueryTextMode();IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;Void set_QueryTextMode(System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
7825-
},
78267826
"System.Nullable`1[System.Boolean] EnableLowPrecisionOrderBy": {
78277827
"Type": "Property",
78287828
"Attributes": [],
@@ -7992,12 +7992,12 @@
79927992
],
79937993
"MethodInfo": "Void set_PopulateIndexMetrics(System.Nullable`1[System.Boolean]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
79947994
},
7995-
"Void set_QueryTextMode(System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
7995+
"Void set_QueryTextMode(Microsoft.Azure.Cosmos.QueryTextMode)[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
79967996
"Type": "Method",
79977997
"Attributes": [
79987998
"CompilerGeneratedAttribute"
79997999
],
8000-
"MethodInfo": "Void set_QueryTextMode(System.Nullable`1[Microsoft.Azure.Cosmos.QueryTextMode]);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
8000+
"MethodInfo": "Void set_QueryTextMode(Microsoft.Azure.Cosmos.QueryTextMode);IsAbstract:False;IsStatic:False;IsVirtual:False;IsGenericMethod:False;IsConstructor:False;IsFinal:False;"
80018001
},
80028002
"Void set_ResponseContinuationTokenLimitInKb(System.Nullable`1[System.Int32])[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]": {
80038003
"Type": "Method",

0 commit comments

Comments
 (0)