Skip to content

Commit 6d3e5e4

Browse files
authored
Merge branch 'microsoft:main' into native-tools
2 parents e81cd50 + de20575 commit 6d3e5e4

File tree

18 files changed

+86
-49
lines changed

18 files changed

+86
-49
lines changed

dotnet/samples/GettingStartedWithAgents/GettingStartedWithAgents.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
2424
<PackageReference Include="Microsoft.Extensions.Configuration.Json" />
2525
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" />
26-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
26+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" VersionOverride="9.0.11" />
2727
<PackageReference Include="Microsoft.Extensions.Http" VersionOverride="9.*" />
2828
<PackageReference Include="Microsoft.Extensions.Http.Resilience" VersionOverride="9.*" />
2929
<PackageReference Include="Microsoft.Extensions.Logging" VersionOverride="9.*" />

dotnet/src/Agents/UnitTests/Agents.UnitTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" />
2020
<PackageReference Include="Microsoft.Extensions.Configuration.Json" />
2121
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" />
22-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
22+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" VersionOverride="9.0.11" />
2323
<PackageReference Include="Microsoft.Extensions.Http" VersionOverride="9.*" />
2424
<PackageReference Include="Microsoft.Extensions.Http.Resilience" VersionOverride="9.*" />
25-
<PackageReference Include="Microsoft.Extensions.Logging" VersionOverride="9.*" />
25+
<PackageReference Include="Microsoft.Extensions.Logging" VersionOverride="9.0.11" />
2626
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" VersionOverride="9.*" />
2727
<PackageReference Include="System.Linq.AsyncEnumerable" />
2828
<PackageReference Include="Moq" />

dotnet/src/VectorData/AzureAISearch/AzureAISearchCollection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public override async IAsyncEnumerable<TRecord> GetAsync(IEnumerable<TKey> keys,
270270
/// <inheritdoc />
271271
public override Task DeleteAsync(TKey key, CancellationToken cancellationToken = default)
272272
{
273-
var stringKey = this.GetStringKey(key);
273+
var stringKey = GetStringKey(key);
274274

275275
// Remove record.
276276
return this.RunOperationAsync(
@@ -287,7 +287,7 @@ public override Task DeleteAsync(IEnumerable<TKey> keys, CancellationToken cance
287287
return Task.CompletedTask;
288288
}
289289

290-
var stringKeys = keys is IEnumerable<string> k ? k : keys.Cast<string>();
290+
var stringKeys = keys is IEnumerable<string> k ? k : keys.Select(GetStringKey);
291291

292292
// Remove records.
293293
return this.RunOperationAsync(
@@ -504,7 +504,7 @@ _ when vectorProperty.EmbeddingGenerator is IEmbeddingGenerator<TInput, Embeddin
504504
{
505505
const string OperationName = "GetDocument";
506506

507-
var stringKey = this.GetStringKey(key);
507+
var stringKey = GetStringKey(key);
508508

509509
var jsonObject = await this.RunOperationAsync(
510510
OperationName,
@@ -787,7 +787,7 @@ private Task<T> RunOperationAsync<T>(string operationName, Func<Task<T>> operati
787787
operationName,
788788
operation);
789789

790-
private string GetStringKey(TKey key)
790+
private static string GetStringKey(TKey key)
791791
{
792792
Verify.NotNull(key);
793793

dotnet/src/VectorData/Pinecone/PineconeCollection.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ public override async IAsyncEnumerable<TRecord> GetAsync(
233233
var keysList = keys switch
234234
{
235235
IEnumerable<string> k => k.ToList(),
236-
IEnumerable<object> k => k.Cast<string>().ToList(),
236+
IEnumerable<Guid> k => k.Select(x => x.ToString()).ToList(),
237+
IEnumerable<object> k => k.Select(x => x.ToString()!).ToList(),
237238
_ => throw new UnreachableException("string key should have been validated during model building")
238239
};
239240
#pragma warning restore CA1851
@@ -287,7 +288,8 @@ public override Task DeleteAsync(IEnumerable<TKey> keys, CancellationToken cance
287288
var keysList = keys switch
288289
{
289290
IEnumerable<string> k => k.ToList(),
290-
IEnumerable<object> k => k.Cast<string>().ToList(),
291+
IEnumerable<Guid> k => k.Select(x => x.ToString()).ToList(),
292+
IEnumerable<object> k => k.Select(x => x.ToString()!).ToList(),
291293
_ => throw new UnreachableException("string key should have been validated during model building")
292294
};
293295

dotnet/src/VectorData/Redis/RedisJsonCollection.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ public override async IAsyncEnumerable<TRecord> GetAsync(IEnumerable<TKey> keys,
284284
var keysList = keys switch
285285
{
286286
IEnumerable<string> k => k.ToList(),
287-
IEnumerable<object> k => k.Cast<string>().ToList(),
287+
IEnumerable<Guid> k => k.Select(x => x.ToString()).ToList(),
288+
IEnumerable<object> k => k.Select(x => x.ToString()!).ToList(),
288289
_ => throw new UnreachableException()
289290
};
290291
#pragma warning restore CA1851 // Possible multiple enumerations of 'IEnumerable' collection

dotnet/test/VectorData/AzureAISearch.ConformanceTests/TypeTests/AzureAISearchKeyTypeTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class AzureAISearchKeyTypeTests(AzureAISearchKeyTypeTests.Fixture fixture
1212
: KeyTypeTests(fixture), IClassFixture<AzureAISearchKeyTypeTests.Fixture>
1313
{
1414
[ConditionalFact]
15-
public virtual Task String() => this.Test<string>("foo");
15+
public virtual Task String() => this.Test<string>("foo", "bar");
1616

1717
public new class Fixture : KeyTypeTests.Fixture
1818
{

dotnet/test/VectorData/CosmosMongoDB.ConformanceTests/TypeTests/CosmosMongoKeyTypeTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ public class CosmosMongoKeyTypeTests(CosmosMongoKeyTypeTests.Fixture fixture)
1313
: KeyTypeTests(fixture), IClassFixture<CosmosMongoKeyTypeTests.Fixture>
1414
{
1515
[ConditionalFact]
16-
public virtual Task ObjectId() => this.Test<ObjectId>(new("652f8c3e8f9b2c1a4d3e6a7b"));
16+
public virtual Task ObjectId() => this.Test<ObjectId>(new("652f8c3e8f9b2c1a4d3e6a7b"), new("b7a6e3d4a1c2b9f8e3c8f256"));
1717

1818
[ConditionalFact]
19-
public virtual Task String() => this.Test<string>("foo");
19+
public virtual Task String() => this.Test<string>("foo", "bar");
2020

2121
[ConditionalFact]
22-
public virtual Task Int() => this.Test<int>(8);
22+
public virtual Task Int() => this.Test<int>(8, 9);
2323

2424
[ConditionalFact]
25-
public virtual Task Long() => this.Test<long>(8L);
25+
public virtual Task Long() => this.Test<long>(8L, 9L);
2626

2727
public new class Fixture : KeyTypeTests.Fixture
2828
{

dotnet/test/VectorData/CosmosNoSql.ConformanceTests/TypeTests/CosmosNoSqlKeyTypeTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class CosmosNoSqlKeyTypeTests(CosmosNoSqlKeyTypeTests.Fixture fixture)
1212
: KeyTypeTests(fixture), IClassFixture<CosmosNoSqlKeyTypeTests.Fixture>
1313
{
1414
[ConditionalFact]
15-
public virtual Task String() => this.Test<string>("foo");
15+
public virtual Task String() => this.Test<string>("foo", "bar");
1616

1717
public new class Fixture : KeyTypeTests.Fixture
1818
{

dotnet/test/VectorData/InMemory.ConformanceTests/TypeTests/InMemoryKeyTypeTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ public class InMemoryKeyTypeTests(InMemoryKeyTypeTests.Fixture fixture)
1414
// The InMemory provider supports all .NET types as keys; below are just a few basic tests.
1515

1616
[ConditionalFact]
17-
public virtual Task Int() => this.Test<int>(8);
17+
public virtual Task Int() => this.Test<int>(8, 9);
1818

1919
[ConditionalFact]
20-
public virtual Task Long() => this.Test<long>(8L);
20+
public virtual Task Long() => this.Test<long>(8L, 9L);
2121

2222
[ConditionalFact]
23-
public virtual Task String() => this.Test<string>("foo");
23+
public virtual Task String() => this.Test<string>("foo", "bar");
2424

25-
protected override async Task Test<TKey>(TKey keyValue)
25+
protected override async Task Test<TKey>(TKey key1, TKey key2)
2626
{
27-
await base.Test(keyValue);
27+
await base.Test(key1, key2);
2828

2929
// For InMemory, delete the collection, otherwise the next test that runs will fail because the collection
3030
// already exists but with the previous key type.

dotnet/test/VectorData/MongoDB.ConformanceTests/TypeTests/MongoKeyTypeTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ public class MongoKeyTypeTests(MongoKeyTypeTests.Fixture fixture)
1313
: KeyTypeTests(fixture), IClassFixture<MongoKeyTypeTests.Fixture>
1414
{
1515
[ConditionalFact]
16-
public virtual Task ObjectId() => this.Test<ObjectId>(new("652f8c3e8f9b2c1a4d3e6a7b"));
16+
public virtual Task ObjectId() => this.Test<ObjectId>(new("652f8c3e8f9b2c1a4d3e6a7b"), new("b7a6e3d4a1c2b9f8e3c8f256"));
1717

1818
[ConditionalFact]
19-
public virtual Task String() => this.Test<string>("foo");
19+
public virtual Task String() => this.Test<string>("foo", "bar");
2020

2121
[ConditionalFact]
22-
public virtual Task Int() => this.Test<int>(8);
22+
public virtual Task Int() => this.Test<int>(8, 9);
2323

2424
[ConditionalFact]
25-
public virtual Task Long() => this.Test<long>(8L);
25+
public virtual Task Long() => this.Test<long>(8L, 9L);
2626

2727
public new class Fixture : KeyTypeTests.Fixture
2828
{

0 commit comments

Comments
 (0)