-
Notifications
You must be signed in to change notification settings - Fork 31
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 UT and parser for ppl tool #57
Add UT and parser for ppl tool #57
Conversation
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #57 +/- ##
=============================================
+ Coverage 44.41% 82.21% +37.79%
- Complexity 30 63 +33
=============================================
Files 6 6
Lines 358 371 +13
Branches 42 45 +3
=============================================
+ Hits 159 305 +146
+ Misses 178 37 -141
- Partials 21 29 +8 ☔ View full report in Codecov by Sentry. |
Signed-off-by: xinyual <[email protected]>
// Joining the string back together | ||
ppl = String.join("|", lists); | ||
} else { | ||
ppl = llmOutput; |
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.
Is the ppl still correct when it's missing source=xxx
?
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.
No. Should we raise error here? In the current logic, it will raise error when executing if we don't start with source=xxx.
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.
Executing
means invoking the ppl transport action, right? If so, I suggest to raise error here since it's not going to success and we can avoid network communication.
Signed-off-by: xinyual <[email protected]>
|
||
private String parseOutput(String llmOutput, String indexName) { | ||
String ppl; | ||
Pattern pattern = Pattern.compile("<ppl>((.|[\\r\\n])+?)</ppl>"); // For ppl like <ppl> source=a \n | fields b </ppl> |
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 the \\r\\n
will match \n
? Do we have UT to ensure this?
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.
The logic is directly from here: https://github.com/opensearch-project/dashboards-assistant/blob/e6359634ff6f532afa983ae0785bc0cd53aee425/server/olly/chains/ppl_generator.ts#L247
But you are right, I don't have UT to cover this line. Will add one.
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.
Already add. It works.
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
Signed-off-by: xinyual <[email protected]>
The backport to
To backport manually, run these commands in your terminal: # Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/skills/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/skills/backport-2.x
# Create a new branch
git switch --create backport-57-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 30e52554d4f5a0b9c80ebcc93bed5091a221f6c9
# Push it to GitHub
git push --set-upstream origin backport-57-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/skills/backport-2.x Then, create a pull request where the |
Description
Add UT and output parser for PPL tool according to the suggestion from @joshuali925
Issues Resolved
Add UT and output parser for PPL tool
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.