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

refactor: replace payload with body for consistency with OpenSearch API #424

Merged
merged 14 commits into from
Dec 9, 2024

Conversation

Yerzhaisang
Copy link
Contributor

Description

  • Updated create_standalone_connector to use body instead of payload as the primary argument for the JSON data.
  • Added deprecation warning for payload, encouraging users to transition to body.
  • Improved error handling to ensure body is provided as a dictionary.

Issues Resolved

#397

Check List

  • New functionality includes testing.
    • All tests pass
  • 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: Yerzhaisang Taskali <[email protected]>
Signed-off-by: Yerzhaisang Taskali <[email protected]>
@Yerzhaisang Yerzhaisang changed the title refactor: replace 'payload' with 'body' for consistency with OpenSearch API refactor: replace payload with body for consistency with OpenSearch API Nov 6, 2024
@@ -31,7 +31,7 @@ def _safe_delete_connector(client, connector_id):

Choose a reason for hiding this comment

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

can you add a test when payload is passed as an argument? also when it does not conform to the datatype

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pyek-bot could you please check added unit test?

opensearch_py_ml/ml_commons/model_connector.py Outdated Show resolved Hide resolved
Signed-off-by: Yerzhaisang Taskali <[email protected]>
Signed-off-by: Yerzhaisang Taskali <[email protected]>
Signed-off-by: Yerzhaisang Taskali <[email protected]>
Signed-off-by: Yerzhaisang Taskali <[email protected]>
Signed-off-by: Yerzhaisang Taskali <[email protected]>
Signed-off-by: Yerzhaisang Taskali <[email protected]>
Signed-off-by: Yerzhaisang Taskali <[email protected]>
Signed-off-by: Yerzhaisang Taskali <[email protected]>
@dhrubo-os dhrubo-os merged commit 8c925c4 into opensearch-project:main Dec 9, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants