Skip to content

Commit 7ae9796

Browse files
committed
Rebase fixes
1 parent e082dca commit 7ae9796

File tree

2 files changed

+26
-73
lines changed

2 files changed

+26
-73
lines changed

.github/workflows/test-on-weaviate-version.yml

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -134,45 +134,3 @@ jobs:
134134
path: ./test-results/*.trx
135135
reporter: dotnet-trx
136136
fail-on-error: false
137-
integration-quick:
138-
name: Quick Integration Tests - v${{ inputs.weaviate-version }}
139-
permissions:
140-
contents: read
141-
checks: write
142-
uses: ./.github/workflows/integration-test.yml
143-
secrets: inherit
144-
with:
145-
test-category: "quick"
146-
test-filter: "(Category!=Slow&Category!=RBAC&FullyQualifiedName~Integration)"
147-
weaviate-version: ${{ inputs.weaviate-version }}
148-
dry-run: ${{ inputs.dry-run }}
149-
150-
integration-slow:
151-
name: Slow Integration Tests - v${{ inputs.weaviate-version }}
152-
permissions:
153-
contents: read
154-
checks: write
155-
needs: [integration-rbac]
156-
if: ${{ inputs.run-slow-tests }}
157-
uses: ./.github/workflows/integration-test.yml
158-
secrets: inherit
159-
with:
160-
test-category: "slow"
161-
test-filter: "(Category=Slow&FullyQualifiedName~Integration)"
162-
weaviate-version: ${{ inputs.weaviate-version }}
163-
dry-run: ${{ inputs.dry-run }}
164-
165-
integration-rbac:
166-
name: RBAC Integration Tests - v${{ inputs.weaviate-version }}
167-
permissions:
168-
contents: read
169-
checks: write
170-
needs: [integration-quick]
171-
if: ${{ inputs.run-slow-tests }}
172-
uses: ./.github/workflows/integration-test.yml
173-
secrets: inherit
174-
with:
175-
test-category: "rbac"
176-
test-filter: "(Category=RBAC&FullyQualifiedName~Integration)"
177-
weaviate-version: ${{ inputs.weaviate-version }}
178-
dry-run: ${{ inputs.dry-run }}

src/Weaviate.Client/gRPC/Search.Builders.cs

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private static V1.SearchRequest BaseSearchRequest(
5050
Vectors = { includeVectors?.Vectors ?? [] },
5151
};
5252

53-
var request = new Grpc.Protobuf.V1.SearchRequest()
53+
var request = new V1.SearchRequest()
5454
{
5555
Collection = collection,
5656
Filters = filters?.InternalFilter,
@@ -143,14 +143,9 @@ groupedTask.Provider is null
143143
return request;
144144
}
145145

146-
private static Grpc.Protobuf.V1.GenerativeProvider GetGenerativeProvider(
147-
Models.GenerativeProvider provider
148-
)
146+
private static V1.GenerativeProvider GetGenerativeProvider(Models.GenerativeProvider provider)
149147
{
150-
var result = new Grpc.Protobuf.V1.GenerativeProvider
151-
{
152-
ReturnMetadata = provider.ReturnMetadata,
153-
};
148+
var result = new V1.GenerativeProvider { ReturnMetadata = provider.ReturnMetadata };
154149

155150
switch (provider)
156151
{
@@ -379,14 +374,14 @@ Models.GenerativeProvider provider
379374
return result;
380375
}
381376

382-
private static Grpc.Protobuf.V1.ConsistencyLevel MapConsistencyLevel(ConsistencyLevels value)
377+
private static V1.ConsistencyLevel MapConsistencyLevel(ConsistencyLevels value)
383378
{
384379
return value switch
385380
{
386-
ConsistencyLevels.Unspecified => Grpc.Protobuf.V1.ConsistencyLevel.Unspecified,
387-
ConsistencyLevels.All => Grpc.Protobuf.V1.ConsistencyLevel.All,
388-
ConsistencyLevels.One => Grpc.Protobuf.V1.ConsistencyLevel.One,
389-
ConsistencyLevels.Quorum => Grpc.Protobuf.V1.ConsistencyLevel.Quorum,
381+
ConsistencyLevels.Unspecified => V1.ConsistencyLevel.Unspecified,
382+
ConsistencyLevels.All => V1.ConsistencyLevel.All,
383+
ConsistencyLevels.One => V1.ConsistencyLevel.One,
384+
ConsistencyLevels.Quorum => V1.ConsistencyLevel.Quorum,
390385
_ => throw new NotSupportedException($"Consistency level {value} is not supported."),
391386
};
392387
}
@@ -413,12 +408,12 @@ private static (
413408
// This also covers the case where no target vector is specified and only one vector is provided
414409
// In this case, we assume the single provided vector is the target
415410
vectors = vector
416-
.Select(v => new Grpc.Protobuf.V1.Vectors
411+
.Select(v => new V1.Vectors
417412
{
418413
Name = v.Key,
419414
Type = v.Value.IsMultiVector
420-
? Grpc.Protobuf.V1.Vectors.Types.VectorType.MultiFp32
421-
: Grpc.Protobuf.V1.Vectors.Types.VectorType.SingleFp32,
415+
? V1.Vectors.Types.VectorType.MultiFp32
416+
: V1.Vectors.Types.VectorType.SingleFp32,
422417
VectorBytes = v.Value.ToByteString(),
423418
})
424419
.ToList();
@@ -444,17 +439,17 @@ private static (
444439
: vector.Values.ElementAt(idx),
445440
}
446441
)
447-
.Select(v => new Grpc.Protobuf.V1.VectorForTarget()
442+
.Select(v => new V1.VectorForTarget()
448443
{
449444
Name = v.Name,
450445
Vectors =
451446
{
452-
new Grpc.Protobuf.V1.Vectors
447+
new V1.Vectors
453448
{
454449
Name = v.Name,
455450
Type = v.Vector.IsMultiVector
456-
? Grpc.Protobuf.V1.Vectors.Types.VectorType.MultiFp32
457-
: Grpc.Protobuf.V1.Vectors.Types.VectorType.SingleFp32,
451+
? V1.Vectors.Types.VectorType.MultiFp32
452+
: V1.Vectors.Types.VectorType.SingleFp32,
458453
VectorBytes = v.Vector.ToByteString(),
459454
},
460455
},
@@ -464,12 +459,12 @@ private static (
464459
else
465460
{
466461
vectors = vector
467-
.Select(v => new Grpc.Protobuf.V1.Vectors
462+
.Select(v => new V1.Vectors
468463
{
469464
Name = v.Key,
470465
Type = v.Value.IsMultiVector
471-
? Grpc.Protobuf.V1.Vectors.Types.VectorType.MultiFp32
472-
: Grpc.Protobuf.V1.Vectors.Types.VectorType.SingleFp32,
466+
? V1.Vectors.Types.VectorType.MultiFp32
467+
: V1.Vectors.Types.VectorType.SingleFp32,
473468
VectorBytes = v.Value.ToByteString(),
474469
})
475470
.ToList();
@@ -478,7 +473,7 @@ private static (
478473
return (targets, vectorForTarget, vectors);
479474
}
480475

481-
private static Grpc.Protobuf.V1.NearTextSearch BuildNearText(
476+
private static V1.NearTextSearch BuildNearText(
482477
string[] query,
483478
double? distance,
484479
double? certainty,
@@ -488,13 +483,13 @@ private static Grpc.Protobuf.V1.NearTextSearch BuildNearText(
488483
)
489484
{
490485
var (targets, _, _) = BuildTargetVector(targetVector, null);
491-
var nearText = new Grpc.Protobuf.V1.NearTextSearch { Query = { query }, Targets = targets };
486+
var nearText = new V1.NearTextSearch { Query = { query }, Targets = targets };
492487

493488
if (moveTo is not null)
494489
{
495490
var uuids = moveTo.Objects is null ? [] : moveTo.Objects.Select(x => x.ToString());
496491
var concepts = moveTo.Concepts is null ? new string[] { } : moveTo.Concepts;
497-
nearText.MoveTo = new Grpc.Protobuf.V1.NearTextSearch.Types.Move
492+
nearText.MoveTo = new V1.NearTextSearch.Types.Move
498493
{
499494
Uuids = { uuids },
500495
Concepts = { concepts },
@@ -506,7 +501,7 @@ private static Grpc.Protobuf.V1.NearTextSearch BuildNearText(
506501
{
507502
var uuids = moveAway.Objects is null ? [] : moveAway.Objects.Select(x => x.ToString());
508503
var concepts = moveAway.Concepts is null ? new string[] { } : moveAway.Concepts;
509-
nearText.MoveAway = new Grpc.Protobuf.V1.NearTextSearch.Types.Move
504+
nearText.MoveAway = new V1.NearTextSearch.Types.Move
510505
{
511506
Uuids = { uuids },
512507
Concepts = { concepts },
@@ -527,14 +522,14 @@ private static Grpc.Protobuf.V1.NearTextSearch BuildNearText(
527522
return nearText;
528523
}
529524

530-
private static Grpc.Protobuf.V1.NearVector BuildNearVector(
525+
private static V1.NearVector BuildNearVector(
531526
Models.Vectors vector,
532527
double? certainty,
533528
double? distance,
534529
TargetVectors? targetVector
535530
)
536531
{
537-
Grpc.Protobuf.V1.NearVector nearVector = new();
532+
V1.NearVector nearVector = new();
538533

539534
if (distance.HasValue)
540535
{
@@ -565,7 +560,7 @@ private static Grpc.Protobuf.V1.NearVector BuildNearVector(
565560
}
566561

567562
private static void BuildBM25(
568-
SearchRequest request,
563+
V1.SearchRequest request,
569564
string query,
570565
string[]? properties = null,
571566
BM25Operator? searchOperator = null
@@ -593,7 +588,7 @@ private static void BuildBM25(
593588
}
594589

595590
private static void BuildHybrid(
596-
Grpc.Protobuf.V1.SearchRequest request,
591+
V1.SearchRequest request,
597592
string? query = null,
598593
float? alpha = null,
599594
Models.Vectors? vector = null,

0 commit comments

Comments
 (0)