From 416312a92b56b9ba741b6001fbc9703976fc527b Mon Sep 17 00:00:00 2001 From: markwallace-microsoft <127216156+markwallace-microsoft@users.noreply.github.com> Date: Fri, 21 Mar 2025 16:52:58 +0000 Subject: [PATCH] Encode Kusto keys that contain a ' --- .../src/Connectors/Connectors.Memory.Kusto/KustoMemoryStore.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotnet/src/Connectors/Connectors.Memory.Kusto/KustoMemoryStore.cs b/dotnet/src/Connectors/Connectors.Memory.Kusto/KustoMemoryStore.cs index 5e28a7a8a016..845adadf87b5 100644 --- a/dotnet/src/Connectors/Connectors.Memory.Kusto/KustoMemoryStore.cs +++ b/dotnet/src/Connectors/Connectors.Memory.Kusto/KustoMemoryStore.cs @@ -104,7 +104,7 @@ public async IAsyncEnumerable GetBatchAsync( bool withEmbeddings = false, [EnumeratorCancellation] CancellationToken cancellationToken = default) { - var inClauseValue = string.Join(",", keys.Select(k => $"'{k}'")); + var inClauseValue = string.Join(",", keys.Select(k => $"'{k.Replace("'", "''")}'")); var query = $"{this.GetBaseQuery(collectionName)} " + $"| where Key in ({inClauseValue}) " + "| project " +