Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
Signed-off-by: Rishabh Maurya <[email protected]>
  • Loading branch information
rishabhmaurya committed Mar 25, 2024
1 parent c621685 commit 113f6f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ public void testDerivedFields() throws Exception {
.startObject("tweet")
.startObject("derived")
.startObject("derived_field_name1")
.field("type", "text")
.field("type", "boolean")
.endObject()
.startObject("derived_field_name2")
.field("type", "keyword")
Expand All @@ -458,7 +458,7 @@ public void testDerivedFields() throws Exception {
.endObject()
.startObject("properties")
.startObject("field_name")
.field("type", "text")
.field("type", "date")
.endObject()
.endObject()
.endObject()
Expand All @@ -472,7 +472,7 @@ public void testDerivedFields() throws Exception {
Mapper mapper = documentMapper.root().getMapper("derived_field_name1");
assertTrue(mapper instanceof DerivedFieldMapper);
DerivedFieldMapper derivedFieldMapper = (DerivedFieldMapper) mapper;
assertEquals("text", derivedFieldMapper.getType());
assertEquals("boolean", derivedFieldMapper.getType());
assertNull(derivedFieldMapper.getScript());

mapper = documentMapper.root().getMapper("derived_field_name2");
Expand All @@ -484,7 +484,7 @@ public void testDerivedFields() throws Exception {
// Check that field in properties was parsed correctly as well
mapper = documentMapper.root().getMapper("field_name");
assertNotNull(mapper);
assertEquals("text", mapper.typeName());
assertEquals("date", mapper.typeName());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
import org.opensearch.index.mapper.CompletionFieldMapper;
import org.opensearch.index.mapper.ContentPath;
import org.opensearch.index.mapper.DateFieldMapper;
import org.opensearch.index.mapper.DerivedFieldMapper;
import org.opensearch.index.mapper.FieldAliasMapper;
import org.opensearch.index.mapper.FieldMapper;
import org.opensearch.index.mapper.GeoPointFieldMapper;
Expand Down Expand Up @@ -198,6 +199,7 @@ public abstract class AggregatorTestCase extends OpenSearchTestCase {
denylist.add(ObjectMapper.NESTED_CONTENT_TYPE); // TODO support for nested
denylist.add(CompletionFieldMapper.CONTENT_TYPE); // TODO support completion
denylist.add(FieldAliasMapper.CONTENT_TYPE); // TODO support alias
denylist.add(DerivedFieldMapper.CONTENT_TYPE); // TODO support derived fields
TYPE_TEST_DENYLIST = denylist;
}

Expand Down

0 comments on commit 113f6f0

Please sign in to comment.