opensearch-project / opensearch-py

Python Client for OpenSearch
https://opensearch.org/docs/latest/clients/python/
Apache License 2.0
359 stars 178 forks source link

Modified generator to generate plugins #700

Closed saimedhi closed 8 months ago

saimedhi commented 8 months ago

Description

Modified the generator to generate plugins. Currently, it generates KNN APIs. I will add integration tests.

Issues Resolved

Closes #693 Closes #697

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.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 72.14%. Comparing base (b2a1796) to head (39273af). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #700 +/- ## ======================================= Coverage 72.14% 72.14% ======================================= Files 89 89 Lines 7945 7945 ======================================= Hits 5732 5732 Misses 2213 2213 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

saimedhi commented 8 months ago

Lint is failing. I will fix it in spec.

************* Module opensearchpy._async.plugins.knn
opensearchpy/_async/plugins/knn.py:232:8: C0103: Argument name "nodeId" doesn't conform to snake_case naming style (invalid-name)
************* Module opensearchpy.plugins.knn
opensearchpy/plugins/knn.py:[23](https://github.com/opensearch-project/opensearch-py/actions/runs/8364328461/job/22899396250?pr=700#step:5:24)2:8: C0103: Argument name "nodeId" doesn't conform to snake_case naming style (invalid-name)
saimedhi commented 8 months ago

READY FOR REVIEW.

Currently facing issues with testing train_model, which are unrelated to the client. Followed documentation while writing tests.


knn train_model response {'model_id': 'my-model'}

knn get_model response {'model_id': 'my-model', 'model_blob': '', 'state': 'failed', 
'timestamp': '2024-03-22T06:44:52.102263Z', 'description': 'My model description', 
'error': 'Failed to execute training. May be caused by an invalid method definition 
or not enough memory to perform training.', 'space_type': 'l2', 'dimension': 4, 'engine': 'faiss'}