-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Remove InvalidShapeException from GeoPolygonDecomposer #77613
Conversation
Pinging @elastic/es-analytics-geo (Team:Analytics) |
@@ -834,9 +834,6 @@ public void testInvalidSelfCrossingPolygon() { | |||
Exception e = expectThrows(InvalidShapeException.class, () -> builder.close().buildS4J()); | |||
assertThat(e.getMessage(), containsString("Self-intersection at or near point [")); | |||
assertThat(e.getMessage(), not(containsString("NaN"))); | |||
e = expectThrows(InvalidShapeException.class, () -> buildGeometry(builder.close())); | |||
assertThat(e.getMessage(), containsString("Self-intersection at or near point [")); | |||
assertThat(e.getMessage(), not(containsString("NaN"))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already tested in GeometryIndexerTests
I change this PR to be a bug fix as it fixes an issue with `ignore_malformed' setting. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fixes a bug where InvalidShapeException are not properly handle so even if the mappings defined with ignore_malformed set to true, the exception leaks and the setting is ignored
#77740) fixes a bug where InvalidShapeException are not properly handle so even if the mappings defined with ignore_malformed set to true, the exception leaks and the setting is ignored
InvalidShapeException comes from Spatial4j dependency and should not be part of GeoPolygonDecomposer. Let's replace this exception with an IllegalArgumentException.
The change actually fixes a bug where InvalidShapeException are not properly handle so even if the mappings defined with
ignore_malformed
set to true, the exception leaks and the setting is ignored. Changing to IllegalArgumentException makes it behave properly.fixes #77685
fixes #75753