-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Refactor FilterPath parse function (#12067) #12131
Refactor FilterPath parse function (#12067) #12131
Conversation
Signed-off-by: Robin Friedmann <robinfriedmann.rf@gmail.com>
Compatibility status:Checks if related components are compatible with change c154bd7 Incompatible componentsIncompatible components: [https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/performance-analyzer-rca.git] Skipped componentsCompatible componentsCompatible components: [https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git, https://github.com/opensearch-project/custom-codecs.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/sql.git] |
❕ Gradle check result for 43f5867: UNSTABLE
Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
libs/core/src/main/java/org/opensearch/core/xcontent/filtering/FilterPath.java
Show resolved
Hide resolved
libs/core/src/main/java/org/opensearch/core/xcontent/filtering/FilterPath.java
Show resolved
Hide resolved
libs/core/src/main/java/org/opensearch/core/xcontent/filtering/FilterPath.java
Show resolved
Hide resolved
Do we have tests covering these already? |
Signed-off-by: Robin Friedmann <robinfriedmann.rf@gmail.com>
There are already a bunch of tests FilterPathTests I just added two that were missing. |
0be57d1
to
997d2fa
Compare
❌ Gradle check result for 0be57d1: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for 997d2fa: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
…2067) Signed-off-by: Robin Friedmann <robinfriedmann.rf@gmail.com>
997d2fa
to
c154bd7
Compare
❌ Gradle check result for c154bd7: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
❌ Gradle check result for c154bd7: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
This PR is stalled because it has been open for 30 days with no activity. |
@deshsidd will you be interested in taking this forward? |
Let me take care of this one |
@deshsidd Are you still on it? |
@@ -369,4 +370,20 @@ public void testMultipleFilterPaths() { | |||
assertThat(filterPath.getSegment(), is(emptyString())); | |||
assertSame(filterPath, FilterPath.EMPTY); | |||
} | |||
|
|||
public void testCompileWithEmptyString() { |
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.
Seems this newly added test case is duplicated with the existing test case:
OpenSearch/libs/core/src/test/java/org/opensearch/core/xcontent/filtering/FilterPathTests.java
Line 122 in 14f1c43
public void testEmptyFilterPath() { |
assertEquals(0, filterPaths.length); | ||
} | ||
|
||
public void testCompileWithNull() { |
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.
Same to above, duplicated.
Closing in lieu of #14200 |
Signed-off-by: Robin Friedmann robinfriedmann.rf@gmail.com
Description
Refactoring FilterPath.parse by using an iterative approach instead of recursion.
Related Issues
Resolves #12067
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.