Skip to content

Commit 6309f7b

Browse files
.Net: Bump Microsoft.Azure.Kusto.Data (#6945)
### Motivation and Context This PR includes the following changes 1. Bump version of `Microsoft.Azure.Kusto.Data` to version 12.2.2 2. Switch from obsolete `NormalizeTableName` to recommended `NormalizeName` Background on this second change: - The default behavior of `NormalizeTableName` is to only add brackets if they seem needed, while `NormalizeName` always does. - Unless you rely on the exact kql generated it shouldn't matter, if you want to force the old behavior add `NormalizationMode.Classic` - The normalization of plenty of identifier kinds has been unified, so you no longer need most of the specialized methods ### Description <!-- Describe your changes, the overall approach, the underlying design. These notes will help understanding how your code works. Thanks! --> ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄 - [ ]
1 parent 8f0a402 commit 6309f7b

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

dotnet/Directory.Packages.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<PackageVersion Include="JsonSchema.Net" Version="5.4.2" />
1919
<PackageVersion Include="Microsoft.Azure.Functions.Worker" Version="1.20.1" />
2020
<PackageVersion Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.1.0" />
21-
<PackageVersion Include="Microsoft.Azure.Kusto.Data" Version="11.3.5" />
21+
<PackageVersion Include="Microsoft.Azure.Kusto.Data" Version="12.2.2" />
2222
<PackageVersion Include="Microsoft.Azure.WebJobs.Extensions.OpenApi" Version="1.5.1" />
2323
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="1.1.1" />
2424
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />

dotnet/src/Connectors/Connectors.Memory.Kusto/KustoMemoryStore.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ protected virtual void Dispose(bool disposing)
358358
/// <param name="collectionName">Kusto table name.</param>
359359
/// <param name="normalized">Boolean flag that indicates if table name normalization is needed.</param>
360360
private static string GetTableName(string collectionName, bool normalized = true)
361-
=> normalized ? CslSyntaxGenerator.NormalizeTableName(collectionName) : collectionName;
361+
=> normalized ? CslSyntaxGenerator.NormalizeName(collectionName) : collectionName;
362362

363363
/// <summary>
364364
/// Converts Kusto table name to collection name.

dotnet/src/Connectors/Connectors.UnitTests/Memory/Kusto/KustoMemoryStoreTests.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public class KustoMemoryStoreTests
2525
private const string DatabaseName = "FakeDb";
2626
private readonly Mock<ICslQueryProvider> _cslQueryProviderMock;
2727
private readonly Mock<ICslAdminProvider> _cslAdminProviderMock;
28+
private readonly string _normalisedCollectionName = CslSyntaxGenerator.NormalizeName(CollectionName);
2829

2930
public KustoMemoryStoreTests()
3031
{
@@ -145,7 +146,7 @@ public async Task ItCanUpsertAsync()
145146
// Assert
146147
this._cslAdminProviderMock.Verify(client => client.ExecuteControlCommandAsync(
147148
DatabaseName,
148-
It.Is<string>(s => s.StartsWith($".ingest inline into table {CollectionName}", StringComparison.Ordinal) && s.Contains(actualMemoryRecordKey, StringComparison.Ordinal)),
149+
It.Is<string>(s => s.StartsWith($".ingest inline into table {this._normalisedCollectionName}", StringComparison.Ordinal) && s.Contains(actualMemoryRecordKey, StringComparison.Ordinal)),
149150
It.IsAny<ClientRequestProperties>()), Times.Once());
150151
Assert.Equal(expectedMemoryRecord.Key, actualMemoryRecordKey);
151152
}
@@ -171,7 +172,7 @@ public async Task ItCanUpsertBatchAsyncAsync()
171172
.Verify(client => client.ExecuteControlCommandAsync(
172173
DatabaseName,
173174
It.Is<string>(s =>
174-
s.StartsWith($".ingest inline into table {CollectionName}", StringComparison.Ordinal) &&
175+
s.StartsWith($".ingest inline into table {this._normalisedCollectionName}", StringComparison.Ordinal) &&
175176
batchUpsertMemoryRecords.All(r => s.Contains(r.Key, StringComparison.Ordinal))),
176177
It.IsAny<ClientRequestProperties>()
177178
), Times.Once());
@@ -306,7 +307,7 @@ public async Task ItCanRemoveAsync()
306307
this._cslAdminProviderMock
307308
.Verify(client => client.ExecuteControlCommandAsync(
308309
DatabaseName,
309-
It.Is<string>(s => s.Replace(" ", " ").StartsWith($".delete table {CollectionName}") && s.Contains(MemoryRecordKey)), // Replace double spaces with single space to account for the fact that the query is formatted with double spaces and to be future proof
310+
It.Is<string>(s => s.Replace(" ", " ").StartsWith($".delete table {this._normalisedCollectionName}") && s.Contains(MemoryRecordKey)), // Replace double spaces with single space to account for the fact that the query is formatted with double spaces and to be future proof
310311
It.IsAny<ClientRequestProperties>()
311312
), Times.Once());
312313
}
@@ -325,7 +326,7 @@ public async Task ItCanRemoveBatchAsync()
325326
this._cslAdminProviderMock
326327
.Verify(client => client.ExecuteControlCommandAsync(
327328
DatabaseName,
328-
It.Is<string>(s => s.Replace(" ", " ").StartsWith($".delete table {CollectionName}") && memoryRecordKeys.All(r => s.Contains(r, StringComparison.OrdinalIgnoreCase))),
329+
It.Is<string>(s => s.Replace(" ", " ").StartsWith($".delete table {this._normalisedCollectionName}") && memoryRecordKeys.All(r => s.Contains(r, StringComparison.OrdinalIgnoreCase))),
329330
It.IsAny<ClientRequestProperties>()
330331
), Times.Once());
331332
}

0 commit comments

Comments
 (0)