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

fix name bug #139

Merged
merged 3 commits into from
Jan 23, 2024
Merged

fix name bug #139

merged 3 commits into from
Jan 23, 2024

Conversation

xinyual
Copy link
Collaborator

@xinyual xinyual commented Jan 22, 2024

Description

When we use pattern, the return metadata map is <index_name>: <index_mapping>. So we need to use the name from mapping instead of pattern name.

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --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.

Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
@@ -149,9 +149,12 @@ public <T> void run(Map<String, String> parameters, ActionListener<T> listener)
GetMappingsRequest getMappingsRequest = buildGetMappingRequest(indexName);
client.admin().indices().getMappings(getMappingsRequest, ActionListener.<GetMappingsResponse>wrap(getMappingsResponse -> {
Map<String, MappingMetadata> mappings = getMappingsResponse.getMappings();
if (mappings.size() == 0) {
throw new IllegalArgumentException("No matching index with index name: " + indexName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems we should useNo matching mapping with ..., is this index from user's input?

Signed-off-by: xinyual <[email protected]>
Copy link

codecov bot commented Jan 22, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (7e4c8d5) 80.83% compared to head (8986b3c) 80.69%.
Report is 1 commits behind head on main.

Files Patch % Lines
.../main/java/org/opensearch/agent/tools/PPLTool.java 60.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #139      +/-   ##
============================================
- Coverage     80.83%   80.69%   -0.15%     
  Complexity      195      195              
============================================
  Files            13       13              
  Lines          1002     1005       +3     
  Branches        133      134       +1     
============================================
+ Hits            810      811       +1     
- Misses          141      142       +1     
- Partials         51       52       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zane-neo zane-neo merged commit 8074492 into opensearch-project:main Jan 23, 2024
11 of 13 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 23, 2024
* fix name bug

Signed-off-by: xinyual <[email protected]>

* apply spotless

Signed-off-by: xinyual <[email protected]>

* change error message

Signed-off-by: xinyual <[email protected]>

---------

Signed-off-by: xinyual <[email protected]>
(cherry picked from commit 8074492)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
xinyual pushed a commit that referenced this pull request Jan 23, 2024
* fix name bug



* apply spotless



* change error message



---------


(cherry picked from commit 8074492)

Signed-off-by: xinyual <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
yuye-aws pushed a commit to yuye-aws/skills that referenced this pull request Apr 26, 2024
* fix name bug

* apply spotless

* change error message

---------

(cherry picked from commit 8074492)

Signed-off-by: xinyual <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: yuye-aws <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants