Skip to content

Commit

Permalink
Kderusso/sparse vector ci failure (elastic#117930) (elastic#118014)
Browse files Browse the repository at this point in the history
* Fix CI failure in SparseVectorQueryBuilderTests
  • Loading branch information
kderusso authored Dec 4, 2024
1 parent 20957d6 commit 4254ca3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,3 @@ tests:
issue: https://github.com/elastic/elasticsearch/issues/117805
- class: org.elasticsearch.xpack.security.authc.ldap.UserAttributeGroupsResolverTests
issue: https://github.com/elastic/elasticsearch/issues/116537
- class: org.elasticsearch.xpack.core.ml.search.SparseVectorQueryBuilderTests
method: testToQuery
issue: https://github.com/elastic/elasticsearch/issues/117998
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,12 @@ public void testToQuery() throws IOException {

private void testDoToQuery(SparseVectorQueryBuilder queryBuilder, SearchExecutionContext context) throws IOException {
Query query = queryBuilder.doToQuery(context);

// test query builder can randomly have no vectors, which rewrites to a MatchNoneQuery - nothing more to do in this case.
if (query instanceof MatchNoDocsQuery) {
return;
}

assertTrue(query instanceof SparseVectorQueryWrapper);
var sparseQuery = (SparseVectorQueryWrapper) query;
if (queryBuilder.shouldPruneTokens()) {
Expand Down

0 comments on commit 4254ca3

Please sign in to comment.