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

Bug Fix: Fix for rag processor throwing NPE when optional parameters are not provided #3057

Merged
merged 5 commits into from
Oct 4, 2024

Conversation

pyek-bot
Copy link
Contributor

@pyek-bot pyek-bot commented Oct 3, 2024

Description

Explicitly checks if parameters are null before serializing field name and value

Related Issues

Resolves #2983 [https://github.com//issues/2983]

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

@pyek-bot pyek-bot had a problem deploying to ml-commons-cicd-env-require-approval October 3, 2024 23:13 — with GitHub Actions Failure
@pyek-bot pyek-bot had a problem deploying to ml-commons-cicd-env-require-approval October 3, 2024 23:13 — with GitHub Actions Failure
@pyek-bot pyek-bot had a problem deploying to ml-commons-cicd-env-require-approval October 4, 2024 03:01 — with GitHub Actions Failure
@pyek-bot pyek-bot had a problem deploying to ml-commons-cicd-env-require-approval October 4, 2024 03:04 — with GitHub Actions Failure
@pyek-bot pyek-bot had a problem deploying to ml-commons-cicd-env-require-approval October 4, 2024 03:04 — with GitHub Actions Failure
Signed-off-by: Pavan Yekbote <[email protected]>
Signed-off-by: Pavan Yekbote <[email protected]>
@pyek-bot pyek-bot had a problem deploying to ml-commons-cicd-env-require-approval October 4, 2024 03:07 — with GitHub Actions Failure
@pyek-bot pyek-bot had a problem deploying to ml-commons-cicd-env-require-approval October 4, 2024 03:07 — with GitHub Actions Failure
@pyek-bot pyek-bot had a problem deploying to ml-commons-cicd-env-require-approval October 4, 2024 03:58 — with GitHub Actions Failure
@pyek-bot pyek-bot had a problem deploying to ml-commons-cicd-env-require-approval October 4, 2024 03:58 — with GitHub Actions Failure
@pyek-bot pyek-bot temporarily deployed to ml-commons-cicd-env-require-approval October 4, 2024 20:04 — with GitHub Actions Inactive
@pyek-bot pyek-bot temporarily deployed to ml-commons-cicd-env-require-approval October 4, 2024 21:06 — with GitHub Actions Inactive
@pyek-bot pyek-bot temporarily deployed to ml-commons-cicd-env-require-approval October 4, 2024 21:06 — with GitHub Actions Inactive
@dhrubo-os
Copy link
Collaborator

@HenryL27 @austintlee could you guys please review the PR? Thanks.

@pyek-bot pyek-bot temporarily deployed to ml-commons-cicd-env-require-approval October 4, 2024 22:05 — with GitHub Actions Inactive
@b4sjoo b4sjoo merged commit b7a0d78 into opensearch-project:main Oct 4, 2024
16 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.11 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.11 2.11
# Navigate to the new working tree
cd .worktrees/backport-2.11
# Create a new branch
git switch --create backport/backport-3057-to-2.11
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b7a0d78c59ddbc8eb4672c60307ed2e4271a31dd
# Push it to GitHub
git push --set-upstream origin backport/backport-3057-to-2.11
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.11

Then, create a pull request where the base branch is 2.11 and the compare/head branch is backport/backport-3057-to-2.11.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Oct 4, 2024
…are not provided (#3057)

* fix (rag npe): optional and empty fields are handled appropriately

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: test cases

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: format violations

Signed-off-by: Pavan Yekbote <[email protected]>

* tests: adding empty params test case

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: remove wildcard import

Signed-off-by: Pavan Yekbote <[email protected]>

---------

Signed-off-by: Pavan Yekbote <[email protected]>
(cherry picked from commit b7a0d78)
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.12 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.12 2.12
# Navigate to the new working tree
cd .worktrees/backport-2.12
# Create a new branch
git switch --create backport/backport-3057-to-2.12
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b7a0d78c59ddbc8eb4672c60307ed2e4271a31dd
# Push it to GitHub
git push --set-upstream origin backport/backport-3057-to-2.12
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.12

Then, create a pull request where the base branch is 2.12 and the compare/head branch is backport/backport-3057-to-2.12.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.13 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.13 2.13
# Navigate to the new working tree
cd .worktrees/backport-2.13
# Create a new branch
git switch --create backport/backport-3057-to-2.13
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b7a0d78c59ddbc8eb4672c60307ed2e4271a31dd
# Push it to GitHub
git push --set-upstream origin backport/backport-3057-to-2.13
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.13

Then, create a pull request where the base branch is 2.13 and the compare/head branch is backport/backport-3057-to-2.13.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.14 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.14 2.14
# Navigate to the new working tree
cd .worktrees/backport-2.14
# Create a new branch
git switch --create backport/backport-3057-to-2.14
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b7a0d78c59ddbc8eb4672c60307ed2e4271a31dd
# Push it to GitHub
git push --set-upstream origin backport/backport-3057-to-2.14
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.14

Then, create a pull request where the base branch is 2.14 and the compare/head branch is backport/backport-3057-to-2.14.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.15 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.15 2.15
# Navigate to the new working tree
cd .worktrees/backport-2.15
# Create a new branch
git switch --create backport/backport-3057-to-2.15
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b7a0d78c59ddbc8eb4672c60307ed2e4271a31dd
# Push it to GitHub
git push --set-upstream origin backport/backport-3057-to-2.15
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.15

Then, create a pull request where the base branch is 2.15 and the compare/head branch is backport/backport-3057-to-2.15.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.16 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.16 2.16
# Navigate to the new working tree
cd .worktrees/backport-2.16
# Create a new branch
git switch --create backport/backport-3057-to-2.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b7a0d78c59ddbc8eb4672c60307ed2e4271a31dd
# Push it to GitHub
git push --set-upstream origin backport/backport-3057-to-2.16
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.16

Then, create a pull request where the base branch is 2.16 and the compare/head branch is backport/backport-3057-to-2.16.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.17 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.17 2.17
# Navigate to the new working tree
cd .worktrees/backport-2.17
# Create a new branch
git switch --create backport/backport-3057-to-2.17
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b7a0d78c59ddbc8eb4672c60307ed2e4271a31dd
# Push it to GitHub
git push --set-upstream origin backport/backport-3057-to-2.17
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.17

Then, create a pull request where the base branch is 2.17 and the compare/head branch is backport/backport-3057-to-2.17.

pyek-bot added a commit to pyek-bot/ml-commons that referenced this pull request Oct 5, 2024
…are not provided (opensearch-project#3057)

* fix (rag npe): optional and empty fields are handled appropriately

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: test cases

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: format violations

Signed-off-by: Pavan Yekbote <[email protected]>

* tests: adding empty params test case

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: remove wildcard import

Signed-off-by: Pavan Yekbote <[email protected]>

---------

Signed-off-by: Pavan Yekbote <[email protected]>
@austintlee
Copy link
Collaborator

Sorry I got to this late. The change looks good, but we need to make it so that only one of 'llmQuestion' and 'llmMessages' is required. I missed that.

ylwu-amzn pushed a commit that referenced this pull request Oct 7, 2024
…are not provided (#3057) (#3065)

* fix (rag npe): optional and empty fields are handled appropriately

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: test cases

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: format violations

Signed-off-by: Pavan Yekbote <[email protected]>

* tests: adding empty params test case

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: remove wildcard import

Signed-off-by: Pavan Yekbote <[email protected]>

---------

Signed-off-by: Pavan Yekbote <[email protected]>
(cherry picked from commit b7a0d78)

Co-authored-by: Pavan Yekbote <[email protected]>
@ylwu-amzn
Copy link
Collaborator

Sorry I got to this late. The change looks good, but we need to make it so that only one of 'llmQuestion' and 'llmMessages' is required. I missed that.

Thanks @austintlee , I see you create a new issue for that #3067
Do you plan to fix that issue in OS 2.18 ? We can check if anyone else can help if you don't have bandwidth

pyek-bot added a commit to pyek-bot/ml-commons that referenced this pull request Oct 7, 2024
…are not provided (opensearch-project#3057)

* fix (rag npe): optional and empty fields are handled appropriately

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: test cases

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: format violations

Signed-off-by: Pavan Yekbote <[email protected]>

* tests: adding empty params test case

Signed-off-by: Pavan Yekbote <[email protected]>

* fix: remove wildcard import

Signed-off-by: Pavan Yekbote <[email protected]>

---------

Signed-off-by: Pavan Yekbote <[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.

[BUG] RAG processor throws null pointer exception
6 participants