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 point in time rest api #191

Merged
merged 12 commits into from
Nov 2, 2022
Merged

Conversation

Arpit-Bandejiya
Copy link
Contributor

@Arpit-Bandejiya Arpit-Bandejiya commented Aug 19, 2022

Signed-off-by: Arpit Bandejiya abandeji@amazon.com

Description

Changes for point in time API

Related issue

opensearch-project/OpenSearch#3959
#227

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: Arpit Bandejiya <abandeji@amazon.com>
Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
@Arpit-Bandejiya Arpit-Bandejiya marked this pull request as ready for review August 22, 2022 08:04
@Arpit-Bandejiya Arpit-Bandejiya requested review from a team, axeoman and deztructor as code owners August 22, 2022 08:04
Copy link

@Bukhtawar Bukhtawar left a comment

Choose a reason for hiding this comment

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

Is there a way we could add tests for the same?

Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
@Arpit-Bandejiya
Copy link
Contributor Author

Is there a way we could add tests for the same?

Have added the tests. Thanks @Bukhtawar

dhruv16dhr
dhruv16dhr previously approved these changes Aug 23, 2022
self.assert_url_called("POST", "/test-index/_search/point_in_time")

def test_delete_one_point_in_time(self):
self.client.delete_point_in_time(body={})

Choose a reason for hiding this comment

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

we should not call delete with empty body . its delete all or delete with list of pit ids in empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, have updated it in the new revision. Thanks!

Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
@@ -48,7 +48,7 @@ def format(session):
session.install("black", "isort")

session.run("isort", "--profile=black", *SOURCE_FILES)
session.run("black", "--target-version=py27", *SOURCE_FILES)
session.run("black", "--target-version=py33", *SOURCE_FILES)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix for running lint formatter in nox, the py27 is not supported any more. We have update it in other places in the same file but this was left.

Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
@Arpit-Bandejiya
Copy link
Contributor Author

@VachaShah @axeoman please have a look

bharath-techie
bharath-techie previously approved these changes Oct 19, 2022
@Arpit-Bandejiya
Copy link
Contributor Author

@dblock please have a look. Thanks!

Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

This is a new API we never shipped, right? Meaning we're not breaking any backwards compatibility here?

Document this in https://github.com/opensearch-project/opensearch-py/blob/main/GETTING_STARTED.md too please. Also #227

test_opensearchpy/test_client/test_point_in_time.py Outdated Show resolved Hide resolved
USER_GUIDE.md Outdated
print('\n Point in time ID:')
print(pit_id)

# To list all point in time which are plive in the cluster

Choose a reason for hiding this comment

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

nit: *alive

USER_GUIDE.md Outdated

# delete point in time
body = {

Choose a reason for hiding this comment

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

nit: should we have better variable naming, applies to pit_id as well

USER_GUIDE.md Outdated Show resolved Hide resolved
USER_GUIDE.md Outdated
@@ -119,7 +120,39 @@ response = client.indices.delete(
print('\nDeleting index:')
print(response)
```
## Making API Calls

### Point in Time API calls

Choose a reason for hiding this comment

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

Should we give a brief about Point In Time here?

Copy link
Contributor Author

@Arpit-Bandejiya Arpit-Bandejiya Oct 27, 2022

Choose a reason for hiding this comment

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

Will update it with the official documentation link later.

Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
@Arpit-Bandejiya
Copy link
Contributor Author

@dblock please take a look. Thanks!

dblock
dblock previously approved these changes Nov 1, 2022
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

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

LGTM, care to rebase?

@dblock dblock requested a review from Bukhtawar November 1, 2022 11:30
Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
@dblock
Copy link
Member

dblock commented Nov 1, 2022

@Arpit-Bandejiya Needs a CHANGELOG entry as well, thx

Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
@Arpit-Bandejiya Arpit-Bandejiya requested review from dblock and dhruv16dhr and removed request for Bukhtawar and dblock November 1, 2022 15:45
@dblock dblock requested review from bharath-techie and removed request for dhruv16dhr November 1, 2022 16:02
Copy link
Collaborator

@VachaShah VachaShah left a comment

Choose a reason for hiding this comment

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

Thank you @Arpit-Bandejiya! This LGTM

@Arpit-Bandejiya
Copy link
Contributor Author

Please merge the PR @opensearch-project/clients

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.

6 participants