diff --git a/noxfile.py b/noxfile.py index 5dcd9d81..8cb22c40 100644 --- a/noxfile.py +++ b/noxfile.py @@ -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) session.run("python", "utils/license-headers.py", "fix", *SOURCE_FILES) lint(session) diff --git a/opensearchpy/_async/client/__init__.py b/opensearchpy/_async/client/__init__.py index d9eb3679..239bef64 100644 --- a/opensearchpy/_async/client/__init__.py +++ b/opensearchpy/_async/client/__init__.py @@ -1953,11 +1953,16 @@ async def list_all_point_in_time(self, params=None, headers=None): Returns the list of point in times which are alive """ return await self.transport.perform_request( - "GET", _make_path("_search", "point_in_time", "_all"), params=params, headers=headers + "GET", + _make_path("_search", "point_in_time", "_all"), + params=params, + headers=headers, ) @query_params() - async def delete_point_in_time(self, body=None, all=False, params=None, headers=None): + async def delete_point_in_time( + self, body=None, all=False, params=None, headers=None + ): """ Delete a point in time @@ -1965,7 +1970,11 @@ async def delete_point_in_time(self, body=None, all=False, params=None, headers= :arg body: a point-in-time id to delete :arg all: set it to `True` to delete all alive point in time. """ - path = _make_path("_search", "point_in_time", "_all") if all else _make_path("_search", "point_in_time") + path = ( + _make_path("_search", "point_in_time", "_all") + if all + else _make_path("_search", "point_in_time") + ) return await self.transport.perform_request( "DELETE", path, params=params, headers=headers, body=body ) @@ -1992,7 +2001,10 @@ async def create_point_in_time(self, index=None, params=None, headers=None): :arg routing: Specific routing value """ return await self.transport.perform_request( - "POST", _make_path(index, "_search", "point_in_time"), params=params, headers=headers + "POST", + _make_path(index, "_search", "point_in_time"), + params=params, + headers=headers, ) @query_params() diff --git a/opensearchpy/client/__init__.py b/opensearchpy/client/__init__.py index 757a22c8..6e3dea01 100644 --- a/opensearchpy/client/__init__.py +++ b/opensearchpy/client/__init__.py @@ -1952,10 +1952,12 @@ def list_all_point_in_time(self, params=None, headers=None): Returns the list of active point in times searches """ return self.transport.perform_request( - "GET", _make_path("_search", "point_in_time", "_all"), params=params, headers=headers + "GET", + _make_path("_search", "point_in_time", "_all"), + params=params, + headers=headers, ) - @query_params() def delete_point_in_time(self, body=None, all=False, params=None, headers=None): """ @@ -1966,9 +1968,13 @@ def delete_point_in_time(self, body=None, all=False, params=None, headers=None): :arg all: set it to `True` to delete all alive point in time. """ - path = _make_path("_search", "point_in_time", "_all") if all else _make_path("_search", "point_in_time") + path = ( + _make_path("_search", "point_in_time", "_all") + if all + else _make_path("_search", "point_in_time") + ) return self.transport.perform_request( - "DELETE", path, params=params, headers=headers, body=body + "DELETE", path, params=params, headers=headers, body=body ) @query_params( @@ -1993,7 +1999,10 @@ def create_point_in_time(self, index=None, params=None, headers=None): :arg routing: Specific routing value """ return self.transport.perform_request( - "POST", _make_path(index, "_search", "point_in_time"), params=params, headers=headers + "POST", + _make_path(index, "_search", "point_in_time"), + params=params, + headers=headers, ) @query_params() diff --git a/test_opensearchpy/test_client/test_point_in_time.py b/test_opensearchpy/test_client/test_point_in_time.py index 47f0c222..0ca63789 100644 --- a/test_opensearchpy/test_client/test_point_in_time.py +++ b/test_opensearchpy/test_client/test_point_in_time.py @@ -34,9 +34,7 @@ def test_create_one_point_in_time(self): 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={ - "pit_id": ["Sample-PIT-ID"] - }) + self.client.delete_point_in_time(body={"pit_id": ["Sample-PIT-ID"]}) self.assert_url_called("DELETE", "/_search/point_in_time") def test_delete_all_point_in_time(self):