Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add null-field checks to shape field mappers #71999

Merged
merged 5 commits into from
Apr 21, 2021

Conversation

romseygeek
Copy link
Contributor

@romseygeek romseygeek commented Apr 21, 2021

#71696 introduced a regression to the various shape field mappers,
where they would no longer handle null values. This commit fixes
that regression and adds a testNullValues method to MapperTestCase
to ensure that all field mappers correctly handle nulls.

Fixes #71874

@romseygeek romseygeek added >non-issue :Search Foundations/Mapping Index mappings, including merging and defining field types v8.0.0 v7.13.0 v7.14.0 labels Apr 21, 2021
@romseygeek romseygeek self-assigned this Apr 21, 2021
@elasticmachine elasticmachine added the Team:Search Meta label for search team label Apr 21, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@romseygeek
Copy link
Contributor Author

Marking as >non-issue because it's an unreleased bug.

Copy link
Contributor

@hendrikmuhs hendrikmuhs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@@ -691,4 +691,16 @@ public final void testIndexTimeStoredFieldsAccess() throws IOException {
.fielddataBuilder("test", lookupSource)
.build(new IndexFieldDataCache.None(), new NoneCircuitBreakerService());
}

public final void testNullInput() throws Exception {
assumeTrue("Mapper does not permit null values", allowsNullValues());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we actually check that when the mapper does not allow null values, an exception is thrown?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a good idea. I think I'm going to revert the changes to rank_features and dense_vectors as well and add them as TODOs because I want to get this into 7.13 and they should get some more discussion.

@romseygeek
Copy link
Contributor Author

@javanna I updated the check to account for exception-throwing cases

Copy link
Member

@javanna javanna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@romseygeek romseygeek merged commit 72f9c4c into elastic:master Apr 21, 2021
@romseygeek romseygeek deleted the bug/geo-shape-nulls branch April 21, 2021 14:54
romseygeek added a commit to romseygeek/elasticsearch that referenced this pull request Apr 21, 2021
elastic#71696 introduced a regression to the various shape field mappers,
where they would no longer handle null values. This commit fixes
that regression and adds a testNullValues method to MapperTestCase
to ensure that all field mappers correctly handle nulls.

Fixes elastic#71874
romseygeek added a commit that referenced this pull request Apr 22, 2021
#71696 introduced a regression to the various shape field mappers,
where they would no longer handle null values. This commit fixes
that regression and adds a testNullValues method to MapperTestCase
to ensure that all field mappers correctly handle nulls.

Fixes #71874
romseygeek added a commit that referenced this pull request Apr 22, 2021
#71696 introduced a regression to the various shape field mappers,
where they would no longer handle null values. This commit fixes
that regression and adds a testNullValues method to MapperTestCase
to ensure that all field mappers correctly handle nulls.

Fixes #71874
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>non-issue :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v7.13.0 v7.14.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Transform] geo_bounds aggregation failed with NPE error
5 participants