-
Notifications
You must be signed in to change notification settings - Fork 141
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
Cleanup Only - Replace calls to Arrays.asList
with too few arguments.
#3193
Cleanup Only - Replace calls to Arrays.asList
with too few arguments.
#3193
Conversation
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.
can u use static import for the Collections.singletonList
& List.of
methods ?
async-query/src/main/java/org/opensearch/sql/spark/cluster/ClusterManagerEventListener.java
Outdated
Show resolved
Hide resolved
...c-query/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceSpec.java
Show resolved
Hide resolved
core/src/main/java/org/opensearch/sql/ast/expression/Argument.java
Outdated
Show resolved
Hide resolved
c2fe00e
to
d9bb503
Compare
...c-query/src/test/java/org/opensearch/sql/spark/asyncquery/AsyncQueryExecutorServiceSpec.java
Show resolved
Hide resolved
core/src/test/java/org/opensearch/sql/planner/DefaultImplementorTest.java
Outdated
Show resolved
Hide resolved
...g/opensearch/sql/opensearch/storage/script/aggregation/dsl/MetricAggregationBuilderTest.java
Outdated
Show resolved
Hide resolved
74bbe73
to
c603113
Compare
For single responsibility, let's focus on replacing calls to Create a new issue for replacing
|
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.
Let's focus on cleanup calls to Arrays.asList
in this PR.
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
… cases where `List` is already imported. Signed-off-by: currantw <[email protected]>
…ptyMap` with `List.of`/`Map.of` in cases where `List`/`Map` is already imported. Signed-off-by: currantw <[email protected]>
…nkchecker job to fail. Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
Signed-off-by: currantw <[email protected]>
d8f31e0
to
82567d3
Compare
Thanks @LantaoJin. I've gone through and reverted all of the changes that aren't specifically related to Please let me know if you have any further review comments. |
Signed-off-by: currantw <[email protected]>
@currantw LGTM |
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.
I only reviewed the product code. Looks good. But there are still some Arrays.asList
calls in test code. Please search all code base and check them. Make sure only immutable list should be replaced.
assertEquals(UNKNOWN, expr.construct(Arrays.asList(STRING, BOOLEAN))); | ||
assertEquals(UNKNOWN, expr.construct(Arrays.asList(INTEGER, DOUBLE, GEO_POINT))); |
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.
These two are missing.
Please search all code base again.
assertEquals(UNKNOWN, expr.construct(Arrays.asList(STRING, BOOLEAN))); | ||
assertEquals(UNKNOWN, expr.construct(Arrays.asList(INTEGER, DOUBLE, GEO_POINT))); | ||
} | ||
|
||
@Test | ||
public void compatibilityCheckShouldPassIfAnySpecificationCompatible() { | ||
assertEquals(DOUBLE, test123.construct(Arrays.asList(DOUBLE))); | ||
assertEquals(DOUBLE, test123.construct(List.of(DOUBLE))); | ||
assertEquals(DATE, test123.construct(Arrays.asList(STRING, BOOLEAN))); |
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.
ditto in L66
Thanks @LantaoJin. As you'll see from the description, the original intent of this cleanup PR was only to replace My (limited) understanding is that, for lists with two or fewer elements, That being said, I am happy to go ahead with switching additional calls from Please let me know how you want to proceed. Thanks! |
Actually I don't think we have any necessary reason to refactor the calls in Tests. They are tests, they are not called in product. The main difference between
|
@LantaoJin thanks for your feedback ! For better clarity and planning onward - before starting the actual coding work - lets first create a detailed issue with the following details:
Thanks again and for everyone's work and contributions - we are making great progress !! |
Thanks @LantaoJin and @YANG-DB. Based on the feedback, I'm just going to close this PR. Think I've dedicated enough time to this already! Will make sure to raise a dedicated issue in the future. |
Description
Cleanup Only - Replace calls to
Arrays.asList
with too few arguments.From IntelliJ IDEA:
Related Issues
None
Check List
--signoff
.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.