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 bug in delete empty memory #1964

Merged
merged 1 commit into from
Jan 31, 2024
Merged

Conversation

Zhangxunmt
Copy link
Collaborator

@Zhangxunmt Zhangxunmt commented Jan 31, 2024

Description

When deleting a memory with no interactions, the response throws an error from the bulk delete interactions which is not expected.

This PR fixes the bug that when deleting an empty memory, the process should go through and delete it successfully.

Before the change:

# Create a new memory/conversation
POST /_plugins/_ml/memory
{
    "name": "Create a new Memory"
}
#Response
{
  "memory_id": "xxxxxxxxx"
}

# Delete empty memory
DELETE /_plugins/_ml/memory/xxxxxxxxx
# Response
{
  "error": {
    "root_cause": [
      {
        "type": "action_request_validation_exception",
        "reason": "Validation Failed: 1: no requests added;"
      }
    ],
    "type": "action_request_validation_exception",
    "reason": "Validation Failed: 1: no requests added;"
  },
  "status": 400
}

After this change, the empty memory is deleted successfully.

DELETE /_plugins/_ml/memory/xxxxxxxxx
# Response
{
  "success": true
}

Issues Resolved

[List any issues this PR will resolve]

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.

@Zhangxunmt Zhangxunmt temporarily deployed to ml-commons-cicd-env January 31, 2024 00:37 — with GitHub Actions Inactive
@Zhangxunmt Zhangxunmt changed the title fix bug in delete empty memoty fix bug in delete empty memory Jan 31, 2024
@Zhangxunmt Zhangxunmt merged commit 45e5199 into opensearch-project:main Jan 31, 2024
6 of 11 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 31, 2024
Signed-off-by: Xun Zhang <[email protected]>
(cherry picked from commit 45e5199)
mingshl pushed a commit that referenced this pull request Jan 31, 2024
austintlee pushed a commit to austintlee/ml-commons that referenced this pull request Mar 19, 2024
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.

3 participants