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

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

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

saimedhi
Copy link
Collaborator

@saimedhi saimedhi commented Sep 27, 2023

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
Copy link

codecov bot commented Sep 27, 2023

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%) ⬇️
opensearchpy/client/ingest.py 50.00% <100.00%> (-1.86%) ⬇️

dblock
dblock previously approved these changes Sep 28, 2023
from .utils import SKIP_IN_PATH, NamespacedClient, _make_path, query_params


class IngestClient(NamespacedClient):
@query_params("master_timeout", "cluster_manager_timeout", "summary")
@query_params("cluster_manager_timeout", "master_timeout")
Copy link
Member

Choose a reason for hiding this comment

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

I imagine this is correct?

Copy link
Collaborator Author

@saimedhi saimedhi Sep 28, 2023

Choose a reason for hiding this comment

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

:arg timeout: Explicit operation timeout
:arg cluster_manager_timeout: Operation timeout for connection
to cluster-manager node.
:arg master_timeout: Operation timeout for connection to master
Copy link
Collaborator

Choose a reason for hiding this comment

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

May be we could keep the comments for master_timeout that it is deprecated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@VachaShah, Do you mean include deprecation msg in the param description using generator.
something like

:arg master_timeout (Deprecated: deprecation message from here ): Explicit operation timeout for connection
to master node

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah! It would be nice to have it in the description of the param.

…uring alignment with the server and maintaining backward compatibility

Signed-off-by: saimedhi <saimedhi@amazon.com>
@VachaShah VachaShah merged commit 7d3c528 into opensearch-project:main Sep 29, 2023
52 checks passed
@saimedhi saimedhi deleted the merge/ingest_client branch October 4, 2023 22:17
roma2023 pushed a commit to roma2023/opensearch-py that referenced this pull request Dec 28, 2023
…uring alignment with the server and maintaining backward compatibility (opensearch-project#513)

Signed-off-by: saimedhi <saimedhi@amazon.com>
Signed-off-by: roma2023 <romasaparhan19@gmail.com>
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.

3 participants