Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: retry_on_conflicts is not bool #795

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 = 0,
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
Loading