Skip to content

Commit

Permalink
fix: retry_on_conflicts is not bool
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
pattrickrice authored and dblock committed Aug 15, 2024
1 parent 19a9113 commit 3e41f5b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
### Fixed
- Fixed Search helper to ensure proper retention of the _collapse attribute in chained operations. ([#771](https://github.com/opensearch-project/opensearch-py/pull/771))
- Fixed the use of `minimum_should_match` with `Bool` to allow the use of string-based value (percent string, combination). ([#780](https://github.com/opensearch-project/opensearch-py/pull/780))
- Fixed incorrect `retry_on_conflict` type ([#795](https://github.com/opensearch-project/opensearch-py/pull/795))
### Updated APIs
- Updated opensearch-py APIs to reflect [opensearch-api-specification@9d3bc34](https://github.com/opensearch-project/opensearch-api-specification/commit/9d3bc340ccd7d049e7d6e14a4aff2293780cb446)
### Security
Expand Down
2 changes: 1 addition & 1 deletion opensearchpy/_async/helpers/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ async def update(
detect_noop: Optional[bool] = True,
doc_as_upsert: Optional[bool] = False,
refresh: Optional[bool] = False,
retry_on_conflict: Optional[bool] = None,
retry_on_conflict: Optional[int] = None,
script: Any = None,
script_id: Optional[str] = None,
scripted_upsert: Optional[bool] = False,
Expand Down
2 changes: 1 addition & 1 deletion opensearchpy/helpers/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def update(
detect_noop: bool = True,
doc_as_upsert: bool = False,
refresh: bool = False,
retry_on_conflict: Any = None,
retry_on_conflict: int = None,
script: Any = None,
script_id: Any = None,
scripted_upsert: bool = False,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ async def test_update_retry_on_conflict(write_client: Any) -> None:

@pytest.mark.parametrize("retry_on_conflict", [None, 0]) # type: ignore
async def test_update_conflicting_version(
write_client: Any, retry_on_conflict: bool
write_client: Any, retry_on_conflict: int
) -> None:
await Wiki.init()
w = Wiki(owner=User(name="Honza Kral"), _id="opensearch-py", views=42)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def test_update_retry_on_conflict(write_client: Any) -> None:


@pytest.mark.parametrize("retry_on_conflict", [None, 0]) # type: ignore
def test_update_conflicting_version(write_client: Any, retry_on_conflict: Any) -> None:
def test_update_conflicting_version(write_client: Any, retry_on_conflict: int) -> None:
Wiki.init()
w = Wiki(owner=User(name="Honza Kral"), _id="opensearch-py", views=42)
w.save()
Expand Down

0 comments on commit 3e41f5b

Please sign in to comment.