opensearch-project / opensearch-py

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

Integrated generated "ingest" client APIs into the existing module #513

Closed saimedhi closed 1 year ago

saimedhi commented 1 year ago

Description

Integrated generated ingest client APIs into the existing module, ensuring alignment with the server and maintaining backward compatibility

Issues Resolved

Related to #477

Testing the "summary" parameter in the "get_pipeline" API resulted in an error indicating that the parameter is unrecognized (Implies generated "get_pipeline" is correct)

put https://localhost:9200/_ingest/pipeline/pipelineid123

{
  "description": "This pipeline processes student data",
  "processors": [
    {
      "set": {
        "description": "Sets the graduation year to 2023",
        "field": "grad_year",
        "value": 2023
      }
    },
    {
      "set": {
        "description": "Sets graduated to true",
        "field": "graduated",
        "value": true
      }
    },
    {
      "uppercase": {
        "field": "name"
      }
    }
  ]
}

{ "acknowledged": true }

get https://localhost:9200/_ingest/pipeline/pipelineid123?summary=true { "error": { "root_cause": [ { "type": "illegal_argument_exception", "reason": "request [/_ingest/pipeline/pipelineid123] contains unrecognized parameter: [summary]" } ], "type": "illegal_argument_exception", "reason": "request [/_ingest/pipeline/pipelineid123] contains unrecognized parameter: [summary]" }, "status": 400 }

Ingest.geo_ip_stats
should be removed from client(Generator is correct)

client.ingest.geo_ip_stats()
 RequestError: RequestError(400, 'no handler found for uri [/_ingest/geoip/stats] and method [GET]', 'no handler found for uri [/_ingest/geoip/stats] and method [GET]')

Before giving your approval, kindly double-check.

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 1 year ago

Codecov Report

Merging #513 (8945885) into main (2feccc2) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #513   +/-   ##
=======================================
  Coverage   70.86%   70.87%           
=======================================
  Files          83       83           
  Lines        7796     7790    -6     
=======================================
- Hits         5525     5521    -4     
+ Misses       2271     2269    -2     
Files Coverage Δ
opensearchpy/_async/client/ingest.py 50.00% <100.00%> (-1.86%) :arrow_down:
opensearchpy/client/ingest.py 50.00% <100.00%> (-1.86%) :arrow_down: