Skip to content

Commit 2dc4794

Browse files
authored
Prepare opensearch-py for 3.0.0 release (#907)
* Updated opensearch-py to reflect the latest OpenSearch API spec Signed-off-by: saimedhi <[email protected]> * Updated opensearch-py to reflect the latest OpenSearch API spec Signed-off-by: saimedhi <[email protected]> * Version bump changes Signed-off-by: saimedhi <[email protected]> * Enforce keyword-only arguments in opensearch-py to prevent usage of positional arguments. Signed-off-by: saimedhi <[email protected]> * Fixing failing unit tests Signed-off-by: saimedhi <[email protected]> * Fixing failing integ tests Signed-off-by: saimedhi <[email protected]> * Fixing lint errors Signed-off-by: saimedhi <[email protected]> * Fixed API Generator as needed for the latest spec changes Signed-off-by: saimedhi <[email protected]> * Removing deprecated APIS and corresponding tests Signed-off-by: saimedhi <[email protected]> * Update guides and samples to use keyword arguments instead of positional arguments Signed-off-by: saimedhi <[email protected]> * Removing deprecated API tests Signed-off-by: saimedhi <[email protected]> * skiping test Signed-off-by: saimedhi <[email protected]> * Updated search_shards api as per latest spec Signed-off-by: saimedhi <[email protected]> * Removing tests related to APIs that are no longer supported Signed-off-by: saimedhi <[email protected]> * Temporarily disabling codecov Signed-off-by: saimedhi <[email protected]> * skipping paginated wlm/stats api tests until spec is added Signed-off-by: saimedhi <[email protected]> --------- Signed-off-by: saimedhi <[email protected]>
1 parent 1a18e58 commit 2dc4794

File tree

116 files changed

+8843
-2615
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+8843
-2615
lines changed

.github/workflows/integration-unreleased.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
entry:
1212
- { branch: "1.x", java-version: "11" }
1313
- { branch: "2.x", java-version: "17" }
14-
- { branch: "main", java-version: "17" }
14+
- { branch: "main", java-version: "21" }
1515

1616
steps:
1717
- name: Checkout OpenSearch

.github/workflows/integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
opensearch_version: [ '2.14.0', '2.16.0' ]
29+
opensearch_version: [ '2.18.0', '2.19.2', '3.0.0' ]
3030
secured: [ "true", "false" ]
3131

3232
steps:

.github/workflows/test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
- name: Run Tests
3737
run: |
3838
python -m nox -rs test-${{ matrix.entry.python-version }}
39-
- name: Upload coverage to Codecov
40-
uses: codecov/codecov-action@v4
41-
with:
42-
token: ${{ secrets.CODECOV_TOKEN }}
43-
files: ./junit/opensearch-py-codecov.xml
39+
# - name: Upload coverage to Codecov
40+
# uses: codecov/codecov-action@v4
41+
# with:
42+
# token: ${{ secrets.CODECOV_TOKEN }}
43+
# files: ./junit/opensearch-py-codecov.xml

.github/workflows/unified-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
stack_version: ["2.8.1"]
12+
stack_version: ["3.0.0"]
1313

1414
steps:
1515
- name: Checkout

CHANGELOG.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,21 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
33

44
## [Unreleased]
55
### Added
6+
### Updated APIs
7+
### Changed
8+
### Deprecated
9+
### Removed
10+
### Fixed
11+
### Security
12+
### Dependencies
13+
14+
## [3.0.0]
15+
### Added
616
- Added option to pass custom headers to 'AWSV4SignerAsyncAuth' ([863](https://github.com/opensearch-project/opensearch-py/pull/863))
717
- Added sync and async sample that uses `search_after` parameter ([859](https://github.com/opensearch-project/opensearch-py/pull/859))
18+
- Enforced mandatory keyword-only arguments for calling auto-generated OpenSearch-py APIs ([#907](https://github.com/opensearch-project/opensearch-py/pull/907))
819
### Updated APIs
20+
- Updated opensearch-py APIs to reflect [opensearch-api-specification@d4eab1a](https://github.com/opensearch-project/opensearch-api-specification/commit/d4eab1a2e59db2b28e58a83df29bd72fc99c71b4)
921
### Changed
1022
- Small refactor of AWS Signer classes for both sync and async clients ([866](https://github.com/opensearch-project/opensearch-py/pull/866))
1123
- Small refactor to fix overwriting the module files when generating apis ([874](https://github.com/opensearch-project/opensearch-py/pull/874))
@@ -266,7 +278,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
266278
- Fixed link checker failing due to relative link ([#760](https://github.com/opensearch-project/opensearch-py/pull/760))
267279
### Security
268280

269-
[Unreleased]: https://github.com/opensearch-project/opensearch-py/compare/v2.8.0...HEAD
281+
[Unreleased]: https://github.com/opensearch-project/opensearch-py/compare/v3.0.0...HEAD
282+
[3.0.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.8.0...v3.0.0
270283
[2.8.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.7.1...v2.8.0
271284
[2.7.1]: https://github.com/opensearch-project/opensearch-py/compare/v2.7.0...v2.7.1
272285
[2.7.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.6.0...v2.7.0

COMPATIBILITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The below matrix shows the compatibility of the [`opensearch-py`](https://pypi.o
1010
| 1.0.0 | 1.0.0-1.2.4 | |
1111
| 1.1.0 | 1.3.0-1.3.7 | |
1212
| 2.x.x | 1.0.0-2.x | client works against OpenSearch 1.x as long as features removed in 2.0 are not used |
13+
| 3.x.x | 1.0.0-3.x | client works against OpenSearch 1.x, 2.x as long as features removed in 3.0 are not used |
1314

1415
## Upgrading
1516

benchmarks/poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

guides/bulk.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ data = [
4545
{ "name": "baz"}
4646
]
4747

48-
response = client.bulk(data)
48+
response = client.bulk(body=data)
4949
if response["errors"]:
5050
print(f"There were errors!")
5151
for item in response["items"]:
@@ -127,3 +127,4 @@ if len(failed) > 0:
127127
if len(succeeded) > 0:
128128
print(f"Bulk-inserted {len(succeeded)} items (streaming_bulk).")
129129
```
130+

guides/plugins/security.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ print(response)
4545
user_name = "test-user"
4646
user_content = {"password": "test_password", "opendistro_security_roles": []}
4747

48-
response = client.security.create_user(user_name, body=user_content)
48+
response = client.security.create_user(username=user_name, body=user_content)
4949
print(response)
5050
```
5151

guides/point_in_time.md

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,11 @@
1-
- [Point-in-Time - Deprecated Implementation Examples](#point-in-time---deprecated-implementation-examples)
2-
- [Point-in-Time - Updated Implementation Examples](#point-in-time---updated-implementation-examples)
1+
- [Point-in-Time](#point-in-time)
32

4-
### Point-in-Time - Deprecated Implementation Examples
3+
### Point-in-Time
54

65
[Point in Time (PIT)](https://opensearch.org/docs/latest/search-plugins/point-in-time/) lets you run different queries against a dataset that is fixed in time.
76

87
Create a point in time on an index.
98

10-
```python
11-
index_name = "test-index"
12-
response = client.create_point_in_time(
13-
index=index_name,
14-
keep_alive="1m"
15-
)
16-
17-
pit_id = response.get("pit_id")
18-
print('\n Point in time ID:')
19-
print(pit_id)
20-
```
21-
22-
List all point in time which are alive in the cluster.
23-
24-
```python
25-
response = client.list_all_point_in_time()
26-
print(response)
27-
```
28-
29-
Delete a point in time.
30-
31-
```python
32-
pit_body = {
33-
"pit_id": [pit_id]
34-
}
35-
response = client.delete_point_in_time(body=pit_body)
36-
print(response)
37-
```
38-
39-
Delete all point in time.
40-
41-
```python
42-
response = client.delete_point_in_time(body=None, all=True)
43-
print(response)
44-
```
45-
46-
47-
### Point-in-Time - Updated Implementation Examples
48-
49-
Create a point in time on an index.
50-
519
```python
5210
index_name = "test-index"
5311
response = client.create_pit(

0 commit comments

Comments
 (0)