Skip to content

Commit

Permalink
Added Tests for Notification and Search Pipeline.ml
Browse files Browse the repository at this point in the history
Signed-off-by: AbitraryYu <[email protected]>
  • Loading branch information
AbitraryYu committed Apr 23, 2024
1 parent d905bef commit 82cebac
Show file tree
Hide file tree
Showing 78 changed files with 12,932 additions and 3,671 deletions.
4 changes: 2 additions & 2 deletions .ci/test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ TEST_SUITE:
- oss

PYTHON_VERSION:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"

PYTHON_CONNECTION_CLASS:
- Urllib3HttpConnection
Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# This should match the team set up in https://github.com/orgs/opensearch-project/teams and include any additional contributors
* @VachaShah @dblock @harshavamsi @axeoman @deztructor @Shephalimittal @saimedhi @florianvazelle
* @VachaShah @dblock @harshavamsi @axeoman @Shephalimittal @saimedhi @florianvazelle
20 changes: 10 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
- name: Install dependencies
run: |
python3.7 -m pip install nox
python3.8 -m pip install nox
- name: Lint the code
run: nox -s lint

Expand All @@ -24,13 +24,13 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
- name: Install dependencies
run: |
python3.7 -m pip install nox
python3.8 -m pip install nox
- name: Run the api generator
run: nox -s generate

Expand All @@ -39,16 +39,16 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python 3.7
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: 3.8
- name: Install build tools
run: |
python3.7 -m pip install --upgrade build
python3.8 -m pip install --upgrade build
- name: Build project for distribution
run: |
python3.7 -m build
python3.8 -m build
twine-check:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.8

- name: Install Dependencies
run: |
python3.7 -m pip install nox
python3.8 -m pip install nox
- name: Make
run: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
draft-a-release:
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ jobs:
strategy:
matrix:
entry:
- { os: 'ubuntu-20.04', python-version: "3.6" }
- { os: 'ubuntu-latest', python-version: "3.7" }
- { os: 'ubuntu-latest', python-version: "3.8" }
- { os: 'ubuntu-latest', python-version: "3.9" }
- { os: 'ubuntu-latest', python-version: "3.10" }
- { os: 'ubuntu-latest', python-version: "3.11" }
- { os: 'macos-latest', python-version: "3.11" }
- { os: 'windows-latest', python-version: "3.11" }
- { os: 'ubuntu-latest', python-version: "3.12" }
- { os: 'macos-latest', python-version: "3.12" }
- { os: 'windows-latest', python-version: "3.12" }

name: test (os=${{ matrix.entry.os }}, python=${{ matrix.entry.python-version }})
continue-on-error: ${{ matrix.entry.experimental || false }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unified-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
stack_version: ['2.4.3']
stack_version: ['2.5.0']

steps:
- name: Checkout
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/update_api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Update API
on:
workflow_dispatch:
schedule:
- cron: "30 3 * * *"
jobs:
update-api:
if: ${{ github.repository == 'opensearch-project/opensearch-py' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Config git to rebase
run: git config --global pull.rebase true
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python3.8 -m pip install nox
- name: Generate API
run: nox -s generate
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: GitHub App token
id: github_app_token
uses: tibdex/[email protected]
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
installation_id: 22958780
- name: Create pull request
id: cpr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ steps.github_app_token.outputs.token }}
commit-message: Updated opensearch-py to reflect the latest OpenSearch API spec (${{ steps.date.outputs.date }})
title: Updated opensearch-py to reflect the latest OpenSearch API spec
body: |
Updated [opensearch-py](https://github.com/opensearch-project/opensearch-py) to reflect the latest [OpenSearch API spec](https://github.com/opensearch-project/opensearch-api-specification/releases/download/main/opensearch-openapi.yaml)
Date: ${{ steps.date.outputs.date }}
branch: automated-api-update
base: main
signoff: true
labels: |
autocut
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

python:
version: 3.7
version: 3.8
install:
- method: pip
path: .
Expand Down
40 changes: 34 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,39 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Added
- Added pylint `assignment-from-no-return` and `unused-variable` (([#658](https://github.com/opensearch-project/opensearch-py/pull/658))
- Added pylint `unnecessary-dunder-calls` (([#655](https://github.com/opensearch-project/opensearch-py/pull/655))
- Changed to use .pylintrc files in root and any directory with override requirements (([#654](https://github.com/opensearch-project/opensearch-py/pull/654))
- Added pylint `unspecified-encoding` and `missing-function-docstring` and ignored opensearchpy for lints (([#643](https://github.com/opensearch-project/opensearch-py/pull/643)))
- Added support for Python 3.12 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717))
- Added service time metrics ([#716](https://github.com/opensearch-project/opensearch-py/pull/716))
- Added `search_pipeline` APIs and `notifications` plugin APIs ([#724](https://github.com/opensearch-project/opensearch-py/pull/724))
### Changed
### Deprecated
### Removed
- Removed support for Python 3.6, 3.7 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717))
### Fixed
- Updated code generator to use native OpenAPI specification ([#721](https://github.com/opensearch-project/opensearch-py/pull/721))
### Updated APIs
- Updated opensearch-py APIs to reflect [opensearch-api-specification@fe6f977](https://github.com/opensearch-project/opensearch-api-specification/commit/fe6f977bcae4e27a2b261fb9599884df5606c0bc)
- Updated opensearch-py APIs to reflect [opensearch-api-specification@29faff0](https://github.com/opensearch-project/opensearch-api-specification/commit/29faff0709b2557acfd4c3c7e053a2c313413633)
### Security
### Dependencies
- Bumps `aiohttp` from >=3,<4 to >=3.9.2,<4 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717))
- Bumps `black` to >=24.3.0 ([#717](https://github.com/opensearch-project/opensearch-py/pull/717))
- Bumps `pytest-asyncio` from <=0.23.5 to <=0.23.6

## [2.5.0]
### Added
- Added pylint `assignment-from-no-return` and `unused-variable` ([#658](https://github.com/opensearch-project/opensearch-py/pull/658))
- Added pylint `unnecessary-dunder-calls` ([#655](https://github.com/opensearch-project/opensearch-py/pull/655))
- Changed to use .pylintrc files in root and any directory with override requirements ([#654](https://github.com/opensearch-project/opensearch-py/pull/654))
- Added pylint `unspecified-encoding` and `missing-function-docstring` and ignored opensearchpy for lints ([#643](https://github.com/opensearch-project/opensearch-py/pull/643))
- Added pylint `line-too-long` and `invalid-name` ([#590](https://github.com/opensearch-project/opensearch-py/pull/590))
- Added pylint `pointless-statement` ([#611](https://github.com/opensearch-project/opensearch-py/pull/611))
- Added a log collection guide ([#579](https://github.com/opensearch-project/opensearch-py/pull/579))
- Added GHA release ([#614](https://github.com/opensearch-project/opensearch-py/pull/614))
- Incorporated API generation into CI workflow and fixed 'generate' nox session ([#660](https://github.com/opensearch-project/opensearch-py/pull/660))
- Added an automated api update bot for opensearch-py ([#664](https://github.com/opensearch-project/opensearch-py/pull/664))
- Enhance generator to generate plugins ([#700](https://github.com/opensearch-project/opensearch-py/pull/700))
- Enhance generator to update changelog only if generated code differs from existing ([#684](https://github.com/opensearch-project/opensearch-py/pull/684))
- Added guide for configuring ssl_assert_hostname ([#694](https://github.com/opensearch-project/opensearch-py/pull/694))
### Changed
- Updated the `get_policy` API in the index_management plugin to allow the policy_id argument as optional ([#633](https://github.com/opensearch-project/opensearch-py/pull/633))
- Updated the `point_in_time.md` guide with examples demonstrating the usage of the new APIs as alternatives to the deprecated ones. ([#661](https://github.com/opensearch-project/opensearch-py/pull/661))
Expand All @@ -21,9 +45,12 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed
- Fix KeyError when scroll return no hits ([#616](https://github.com/opensearch-project/opensearch-py/pull/616))
- Fix reuse of `OpenSearch` using `Urllib3HttpConnection` and `AsyncOpenSearch` after calling `close` ([#639](https://github.com/opensearch-project/opensearch-py/pull/639))
### Updated APIs
- Updated opensearch-py APIs to reflect [opensearch-api-specification@3763fdd](https://github.com/opensearch-project/opensearch-api-specification/commit/3763fdd051889c26e4f865734501c483d429de9f)
- Updated opensearch-py APIs to reflect [opensearch-api-specification@1787056](https://github.com/opensearch-project/opensearch-api-specification/commit/178705681e5fd812ab59ad00cefa04146d03d7ad)
### Security
### Dependencies
- Bumps `pytest-asyncio` from <=0.21.1 to <=0.23.4
- Bumps `pytest-asyncio` from <=0.21.1 to <=0.23.5
- Bumps `urllib3` from >=1.26.18 to >=1.26.18, <2 ([#632](https://github.com/opensearch-project/opensearch-py/pull/632))

## [2.4.2]
Expand Down Expand Up @@ -208,7 +235,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed Wrong return type hint in `async_scan` ([520](https://github.com/opensearch-project/opensearch-py/pull/520))
### Security

[Unreleased]: https://github.com/opensearch-project/opensearch-py/compare/v2.4.2...HEAD
[Unreleased]: https://github.com/opensearch-project/opensearch-py/compare/v2.5.0...HEAD
[2.5.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.4.2...v2.5.0
[2.4.2]: https://github.com/opensearch-project/opensearch-py/compare/v2.4.0...v2.4.2
[2.4.1]: https://github.com/opensearch-project/opensearch-py/compare/v2.4.0...v2.4.1
[2.4.0]: https://github.com/opensearch-project/opensearch-py/compare/v2.3.2...v2.4.0
Expand Down
2 changes: 1 addition & 1 deletion COMPATIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The below matrix shows the compatibility of the [`opensearch-py`](https://pypi.o
| --- | --- | --- |
| 1.0.0 | 1.0.0-1.2.4 | |
| 1.1.0 | 1.3.0-1.3.7 | |
| 2.x.x | 1.0.0-2.11.0 | client works against OpenSearch 1.x as long as features removed in 2.0 are not used |
| 2.x.x | 1.0.0-2.11.1 | client works against OpenSearch 1.x as long as features removed in 2.0 are not used |

## Upgrading

Expand Down
4 changes: 2 additions & 2 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

## Prerequisites

Python 3.6 or newer is required.
Python 3.8 or newer is required.

```
$ python --version
Expand Down Expand Up @@ -125,7 +125,7 @@ Open `docs/build/html/index.html` to see results.

## Client Code Generator

OpenSearch publishes an [OpenAPI specification](https://github.com/opensearch-project/opensearch-api-specification/blob/main/OpenSearch.openapi.json) in the [opensearch-api-specification](https://github.com/opensearch-project/opensearch-api-specification) repository, which is used to auto-generate the less interesting parts of the client.
OpenSearch publishes an [OpenAPI specification](https://github.com/opensearch-project/opensearch-api-specification/releases/download/main/opensearch-openapi.yaml) in the [opensearch-api-specification](https://github.com/opensearch-project/opensearch-api-specification) repository, which is used to auto-generate the less interesting parts of the client.

```
nox -rs generate
Expand Down
Loading

0 comments on commit 82cebac

Please sign in to comment.