Skip to content

Commit

Permalink
Address Review Comments
Browse files Browse the repository at this point in the history
Signed-off-by: Naveen Tatikonda <[email protected]>
  • Loading branch information
naveentatikonda committed Mar 18, 2024
1 parent e0cb80d commit efd70d2
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,11 @@ protected boolean isFaissSQfp16(MethodComponentContext methodComponentContext) {
return false;
}

// Validate if the object is of type MethodComponentContext before casting it later
if (!(methodComponentParams.get(METHOD_ENCODER_PARAMETER) instanceof MethodComponentContext)) {
return false;

Check warning on line 604 in src/main/java/org/opensearch/knn/index/mapper/KNNVectorFieldMapper.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/knn/index/mapper/KNNVectorFieldMapper.java#L604

Added line #L604 was not covered by tests
}

MethodComponentContext encoderMethodComponentContext = (MethodComponentContext) methodComponentParams.get(METHOD_ENCODER_PARAMETER);

// returns true if encoder name is "sq" and type is "fp16"
Expand Down

0 comments on commit efd70d2

Please sign in to comment.