Commit Graph

79 Commits

Author SHA1 Message Date
Daniel (dB.) Doubrovkine 87e531b943 Changed URL for API spec. (#757)
Signed-off-by: dblock <dblock@amazon.com>
2024-06-12 21:48:29 -07:00
Sai Medhini Reddy Maryada 9a67bbfd16 fixed generator (#738)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2024-05-01 16:59:17 -04:00
Sai Medhini Reddy Maryada b47edf906e Code generated using native OpenAPI specification (#724)
* Code generated using native OpenAPI specification

Signed-off-by: saimedhi <saimedhi@amazon.com>

* Code generated using native OpenAPI specification

Signed-off-by: saimedhi <saimedhi@amazon.com>

* Code generated using native OpenAPI specification

Signed-off-by: saimedhi <saimedhi@amazon.com>

---------

Signed-off-by: saimedhi <saimedhi@amazon.com>
2024-04-17 16:22:14 -07:00
Sai Medhini Reddy Maryada 0e28f5ffe9 Updated code generator to use new version of OpenAPI specification (#721)
* Updated code generator to use new version of OpenAPI specification

Signed-off-by: saimedhi <saimedhi@amazon.com>

* Updated code generator to use native OpenAPI specification

Signed-off-by: saimedhi <saimedhi@amazon.com>

---------

Signed-off-by: saimedhi <saimedhi@amazon.com>
2024-04-17 17:22:10 -04:00
Sai Medhini Reddy Maryada ba715b9d3f Dropped support for python 3.6, 3.7 and added support for python 3.12 (#717)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2024-04-06 11:18:47 -04:00
Sai Medhini Reddy Maryada 25db5d5c8a Modified generator to generate plugins (#700)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2024-03-22 07:53:28 -04:00
Sai Medhini Reddy Maryada d36a882eaf Enhance generator to update changelog only if generated code differs from existing (#684)
* Enhance generator to update changelog only if generated code differs from existing

Signed-off-by: saimedhi <saimedhi@amazon.com>

* Enhance generator to update changelog only if generated code differs from existing

Signed-off-by: saimedhi <saimedhi@amazon.com>

---------

Signed-off-by: saimedhi <saimedhi@amazon.com>
2024-03-04 16:24:29 -05:00
Sai Medhini Reddy Maryada b2638fbb47 fix Update changelog in api generator (#675)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2024-02-09 08:47:11 -05:00
Sai Medhini Reddy Maryada b9d9bae06e Adding changelog update in API generator (#669)
* Update changelog with api generator

Signed-off-by: saimedhi <saimedhi@amazon.com>

* Update changelog with api generator

Signed-off-by: saimedhi <saimedhi@amazon.com>

---------

Signed-off-by: saimedhi <saimedhi@amazon.com>
2024-02-07 16:23:44 -05:00
Mark Cohen a80bab2ad5 Assignment from no return (#658)
* added unnecessary-dunder-call to pylintrc files; disabled for certain lines

in run_tests.py, exception thrown by 'git remote add origin' when the remote already exists will not exit

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* updates to adhere to assignment-from-no-return lint

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* simplified get_value_filter in Facet to return None
added assert to test get_value_filter returning None

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* added option to output HTML test coverage locally from run_tests.py

returning None from test_faceted_search.Facet.get_value_filter

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* added unused-variable lints; replaced unused variables with _ or referenced them

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* updated CHANGELOG to point to the right PR

Signed-off-by: Mark Cohen <markcoh@amazon.com>

---------

Signed-off-by: Mark Cohen <markcoh@amazon.com>
2024-01-25 15:17:09 -08:00
Mark Cohen 0ddbf8cafa Pylint integration updates (#643)
* updated files with docstrings to pass pylint

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* updated samples to prepare for enabling missing-docstring linter; will continue to work on this before committing setup.cfg

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* removed missing-function-docstring from setup.cfg so the linter doesn't fail while work on docstrings continues

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* corrected unnecessary return docstring values

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* fixing failure in 'black' on reformatting

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* updated utils to pass missing-function-docstring tests

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* updated functions with missing docstrings or pylint ignore instructions; added a utility to automatically add these ignore instructions to most functions that should be self-describing; rolled back some automatically generated code mistakenly changed

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* * ignoring opensearchpy for pylint and then added it back to noxfile.py
* fixed some lints; created a feature flag for newer dynamic pylint so now lints can be fixed first in legacy code and then enabled by multiple people
* extracted a method for per-folder linting
* updated noxfile.lint_per_folder with type hints
* enabled unspecified-encoding in pylint
* added disable missing-function-docstring pragma to test_clients.py in test_async and test_server
* added more encodings to pass unspecified-encoding pylint tests
* updated changelog
Signed-off-by: Mark Cohen <markcoh@amazon.com>

* updated CHANGELOG.md entry
removed the feature flag for pylint lint_per_folder
fixed failures from mypy and pylint
removed pylint MESSAGE CONTROL config from setup.cfg after relocating to lint_per_folder method
Signed-off-by: Mark Cohen <markcoh@amazon.com>

* removed pylint ignore missing-function-docstring

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* added pylint.extensions.docparams plugin

updated some docstrings to correct parameters

removed pylint from setup.cfg

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* added four lints for opensearchpy/

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* adding await back to client.info() call

Signed-off-by: Mark Cohen <markcoh@amazon.com>

* updated TODOs as requested

renamed test_opensearchpy.test_async.test_server.test_helpers.conftest.setup_ubq_tests to setup_update_by_query_tests

added
OpenSearch-main/rest-api-spec/src/main/resources/rest-api-spec/test/indices/stats/50_noop_update[0]
to skip tests list

run_tests.py catches a CalledProcessError when the git repo already exists and the command to add the origin fails in fetch_opensearch_repo()

Signed-off-by: Mark Cohen <markcoh@amazon.com>

---------

Signed-off-by: Mark Cohen <markcoh@amazon.com>
2024-01-19 13:36:05 -05:00
James Addison 0837c5b916 Remove unnecessary utf-8 header in license_headers.py (follow-up to #615) (#617)
* License tools: remove utf-8 coding declaration from license_headers.py check/fix script; since #615 it is no longer used in the library's codebase

UTF-8 is the default encoding used to read source code files for Python3 - see https://docs.python.org/3/howto/unicode.html#unicode-literals-in-python-source-code

Signed-off-by: James Addison <james@reciperadar.com>

* Cleanup: remove utf-8 coding declaration from the license_headers.py script itself

Signed-off-by: James Addison <james@reciperadar.com>

* Update CHANGELOG.md

Signed-off-by: James Addison <james@reciperadar.com>

---------

Signed-off-by: James Addison <james@reciperadar.com>
2023-11-28 14:00:31 -05:00
Samuel Orji 6f26eb3e8e remove unnecessary utf-8 header in .py files (#615)
* remove unnecessary utf-8 header in .py files

Signed-off-by: samuel orji <awesomeorji@gmail.com>

* review feedback: add link to changelog

Signed-off-by: samuel orji <awesomeorji@gmail.com>

---------

Signed-off-by: samuel orji <awesomeorji@gmail.com>
2023-11-24 16:19:50 -05:00
Daniel (dB.) Doubrovkine 1801ada270 Added pylint, enforce naming. (#590)
* Added pylint.

Signed-off-by: dblock <dblock@amazon.com>

* Enforce pylint:invalid-name.

Signed-off-by: dblock <dblock@amazon.com>

* Updated the generated code header to prevent broken links.

Signed-off-by: dblock <dblock@amazon.com>

* Swapped order of messages.

Signed-off-by: dblock <dblock@amazon.com>

---------

Signed-off-by: dblock <dblock@amazon.com>
2023-11-21 10:04:39 -08:00
Daniel (dB.) Doubrovkine 4874437fb5 Fix: version number in filename for distribution. (#588)
Signed-off-by: dblock <dblock@amazon.com>
2023-11-15 15:03:06 -05:00
Daniel (dB.) Doubrovkine 56c96d7c4f Expanded type coverage to benchmarks, samples and tests. (#566)
* Renamed json samples to fix duplicate module name.

Signed-off-by: dblock <dblock@amazon.com>

* Enabled mypy on all source files.

Signed-off-by: dblock <dblock@amazon.com>

* Added missing types.

Signed-off-by: dblock <dblock@amazon.com>

* Added CHANGELOG.

Signed-off-by: dblock <dblock@amazon.com>

* Move type: ignore to fix untyped decorator makes function untyped.

Signed-off-by: dblock <dblock@amazon.com>

* Fix nox -rs lint-3.7.

Signed-off-by: dblock <dblock@amazon.com>

* Fixed incorrect import.

Signed-off-by: dblock <dblock@amazon.com>

* Fix broken test.

Signed-off-by: dblock <dblock@amazon.com>

* Fixed TestBulk::test_bulk_works_with_bytestring_body.

Signed-off-by: dblock <dblock@amazon.com>

---------

Signed-off-by: dblock <dblock@amazon.com>
2023-11-09 10:51:20 -05:00
Daniel (dB.) Doubrovkine dcb79cc322 Merge .pyi type stubs inline (#563)
* Merged types into .py code.

Signed-off-by: dblock <dblock@amazon.com>

* Fix: nox -rs generate.

Signed-off-by: dblock <dblock@amazon.com>

* Updated CHANGELOG.

Signed-off-by: dblock <dblock@amazon.com>

* Use lowest common python version for lint.

Signed-off-by: dblock <dblock@amazon.com>

* Fix: don't typeshed.

Signed-off-by: dblock <dblock@amazon.com>

* Removed unneeded comment.

Signed-off-by: dblock <dblock@amazon.com>

* Simplify OPENSEARCH_URL.

Signed-off-by: dblock <dblock@amazon.com>

* Fix: positional ignore_status used as chunk_size.

Signed-off-by: dblock <dblock@amazon.com>

* Fix: parse version string.

Signed-off-by: dblock <dblock@amazon.com>

* Remove future annotations for Python 3.6.

Signed-off-by: dblock <dblock@amazon.com>

* Fix: types in documentation.

Signed-off-by: dblock <dblock@amazon.com>

* Improve CHANGELOG text.

Signed-off-by: dblock <dblock@amazon.com>

* Re-added missing separator.

Signed-off-by: dblock <dblock@amazon.com>

* Remove duplicate licenses.

Signed-off-by: dblock <dblock@amazon.com>

* Get rid of Optional[Any].

Signed-off-by: dblock <dblock@amazon.com>

* Fix docs with AsyncOpenSearch.

Signed-off-by: dblock <dblock@amazon.com>

* Fix: undo comment.

Signed-off-by: dblock <dblock@amazon.com>

---------

Signed-off-by: dblock <dblock@amazon.com>
2023-11-06 10:08:19 -08:00
Daniel (dB.) Doubrovkine bcfef113c4 Added samples, benchmarks and docs for nox format. (#556)
* Added samples for nox format.

Signed-off-by: dblock <dblock@amazon.com>

* Added space after #!/usr/bin/env python.

Signed-off-by: dblock <dblock@amazon.com>

* Added benchmarks and docs.

Signed-off-by: dblock <dblock@amazon.com>

---------

Signed-off-by: dblock <dblock@amazon.com>
2023-10-26 19:55:50 -07:00
Daniel (dB.) Doubrovkine 0da60b2623 Added a utf-8 header to all .py files (#557)
Signed-off-by: dblock <dblock@amazon.com>
2023-10-26 13:34:34 -04:00
Daniel (dB.) Doubrovkine ebd50e0515 Override put_mapping definition to make index name optional. (#553)
Signed-off-by: dblock <dblock@amazon.com>
2023-10-26 11:31:13 -04:00
Sai Medhini Reddy Maryada 1190079f51 Generate opensearch-py client from API specs (#551)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2023-10-26 10:58:33 -04:00
Sai Medhini Reddy Maryada ce835fb59d Generate cluster client from API specs (#530)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2023-10-09 17:57:09 -04:00
Sai Medhini Reddy Maryada e4c59e4732 Modified generator to generate api deprecation warnings (#527)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2023-10-09 16:47:26 -04:00
Sai Medhini Reddy Maryada 70db37a3c0 Modified generator to generate 'options' and 'default value' for parameters in description (#519)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2023-10-03 10:43:05 -04:00
Sai Medhini Reddy Maryada 7d3c528dff Integrated generated ingest client APIs into the existing module, ensuring alignment with the server and maintaining backward compatibility (#513)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2023-09-28 20:18:53 -07:00
Sai Medhini Reddy Maryada 2feccc22bb Integrated generated APIs into the existing module, ensuring alignment with the server and maintaining backward compatibility (#508)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2023-09-26 12:49:25 -04:00
Sai Medhini Reddy Maryada c6c7df5461 Updated APIs to match other clients and opensearch openapi spec (#502)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2023-09-26 12:46:18 -04:00
Sai Medhini Reddy Maryada 8485606913 Added generating imports and headers to API generator (#467)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2023-08-02 15:00:20 -07:00
Sai Medhini Reddy Maryada bc6a50b0b9 Enhanced existing API generator to use OpenSearch OpenAPI spec (#412)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2023-06-27 11:56:55 -07:00
aiudirog f1f73e7ff2 Fixed utils/build-dists.py which was broken by 49ae7c7 (#316)
* Fixed utils/build-dists.py which was broken by 49ae7c7
Previously the async helpers imported AsyncOpenSearch and therefore failed to import anytime it did

Signed-off-by: Roger Aiudi <aiudirog@gmail.com>

* Refactor async helpers try block to a simple if statement

Signed-off-by: Roger Aiudi <aiudirog@gmail.com>

* Remove newline to pass black

Signed-off-by: Roger Aiudi <aiudirog@gmail.com>

---------

Signed-off-by: Roger Aiudi <aiudirog@gmail.com>
2023-03-08 17:34:43 -08:00
Sai Medhini Reddy Maryada c58375aa7b Merging opensearch-dsl-py to opensearch-py (#287)
Signed-off-by: saimedhi <saimedhi@amazon.com>
2023-02-14 15:03:56 -08:00
Arnav Das 2d03dc773b Alerting Plugins (#93)
* Alert Plugin

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* lint file header license

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* Tests For Alerting[Monitors]

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* Tests For Alerting[Destinations]

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* dynamic lookup 90#issuecomment-1003396742

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* Alerting Async

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* Lint Changes

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* alerting plugins integration tests

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* Integ UnitTests Skip on OPENSEARCH_VERSION >= 2.0.0

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* Unit Test Skip Complete

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* License Headers fixed

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* test_urllib3_connection timeout

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* lint

Signed-off-by: Arnav Das <arnav.das88@gmail.com>

* Fix licenses in all files

Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>

* Remove elastic search licenses on new files

Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>

* Fix formatting

Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>

Signed-off-by: Arnav Das <arnav.das88@gmail.com>
Signed-off-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
Co-authored-by: Harsha Vamsi Kalluri <harshavamsi096@gmail.com>
2022-10-03 14:45:18 -04:00
Vacha Shah b1eaba0064 Type removal breaking changes (#151)
* Breaking changes for type removal

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Adding support to test against unreleased OpenSearch

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Formatting

Signed-off-by: Vacha Shah <vachshah@amazon.com>

* Addressing comments to refactor run-opensearch.sh

Signed-off-by: Vacha Shah <vachshah@amazon.com>
2022-04-13 10:47:48 -07:00
Philip May 4056fa0176 fix black formatting for new version
Signed-off-by: Philip May <philip@may.la>
2022-02-05 00:13:37 -08:00
Rushi Agrawal eaa0cd8765 Update setup.py to correctly pick up Python files
And also re-update package name in utils/build-dists.py so that it is
uninstalled successfully

Signed-off-by: Rushi Agrawal <rushi.agr@gmail.com>
2021-09-19 18:18:09 -07:00
Rushi Agrawal ef88f43a72 Update package name to opensearch-py (#72)
Since opensearch is already taken, update distribution name to opensearch-py.
Update build utils accordingly to fix package name change.

Signed-off-by: Rushi Agrawal <rushi.agr@gmail.com>
2021-09-16 13:51:57 -07:00
Rushi Agrawal ef0c23c0e4 Rename module to opensearchpy
To avoid conflict with an existing package by name 'opensearch' being
present

Signed-off-by: Rushi Agrawal <rushi.agr@gmail.com>
2021-09-16 21:23:38 +05:30
Rushi Agrawal f4891be3c3 Fix potential security issues with jinja2 and pyyaml dep
Added escaping to jinja templates. With PyYAML dependency, accidentally
added '<3.4.1' whereas the intent was to make it '==3.4.1', while fixing
as per dependabot alert. Fixed it now.

Signed-off-by: Rushi Agrawal <rushi.agr@gmail.com>
2021-09-09 19:05:18 +05:30
Rushi Agrawal c6cae11f97 Use opensearch1 instead of opensearch7 as example in tests
Signed-off-by: Rushi Agrawal <rushi.agr@gmail.com>
2021-08-19 07:58:20 +05:30
Rushi Agrawal 9e9269c8f3 Rename Elasticsearch -> OpenSearch
Signed-off-by: Rushi Agrawal <rushi.agr@gmail.com>
2021-08-19 07:58:20 +05:30
Shephali Mittal 924d71729a Add SPDX and OpenSearch Modification license header
Signed-off-by: Shephali Mittal <shephalm@amazon.com>
2021-08-10 19:36:47 +05:30
Pierre Grimaud 305f894c1f [7.x] Fix typos in documentation
Co-authored-by: Seth Michael Larson <seth.larson@elastic.co>
2021-05-25 07:48:43 -05:00
Seth Michael Larson 794a97578f [7.x] Start using the Elastic Artifacts API for YAML REST tests 2021-04-22 12:08:05 -05:00
Seth Michael Larson e4cdd4544d [7.x] Add per-request authentication for http_auth and api_key 2021-04-19 17:26:44 -05:00
Seth Michael Larson f8ffb2cd0a [7.x] Generate APIs using Elastic build artifacts API 2021-04-19 14:39:21 -05:00
Seth Michael Larson a728aaa491 [7.x] Sort imports with isort and regenerate APIs 2021-01-13 14:21:04 -06:00
Seth Michael Larson 3d14e4ff27 [7.x] Handle qualified version snapshots with make.sh
Co-authored-by: Seth Michael Larson <seth.larson@elastic.co>
2020-11-23 17:33:00 -06:00
Seth Michael Larson 0ff76b1648 [7.x] Update build-dists to support all Elastic version specifiers 2020-11-17 12:06:14 -06:00
github-actions[bot] 21f25419eb [7.x] Change 'make.sh release' to 'make.sh assemble'
Co-authored-by: Seth Michael Larson <seth.larson@elastic.co>
2020-11-10 13:45:05 -06:00
Seth Michael Larson 708e282eaf [7.x] Actually dockerize repo, update build-dists for release manager 2020-11-04 13:58:42 -06:00