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

Document.update() should accept fields set to None or empty #1820

Merged
merged 2 commits into from
May 20, 2024

Conversation

miguelgrinberg
Copy link
Collaborator

Fixes #1819

@miguelgrinberg miguelgrinberg added the backport 8.x Backport to 8.x label May 8, 2024
@miguelgrinberg miguelgrinberg force-pushed the update-empty-field branch 2 times, most recently from 26401a9 to ce95ec2 Compare May 10, 2024 18:15
Comment on lines 523 to 530
while True:
try:
r = await Tags.search().execute()
d = r.hits[0]
except IndexError:
continue
else:
break
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this loop for? Do you need a refresh instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, I tried to find how other tests dealt with asynchronous updates and missed the refresh option. Yes, this would be handle much cleanly with a refresh, I'll update it.

@miguelgrinberg miguelgrinberg merged commit 8e7b138 into elastic:main May 20, 2024
16 checks passed
@miguelgrinberg miguelgrinberg deleted the update-empty-field branch May 20, 2024 09:28
github-actions bot pushed a commit that referenced this pull request May 20, 2024
* Document.update() should accept fields set to None or empty

Fixes #1819

* use refresh instead of wait loop

(cherry picked from commit 8e7b138)
miguelgrinberg added a commit that referenced this pull request May 20, 2024
…1828)

* Document.update() should accept fields set to None or empty

Fixes #1819

* use refresh instead of wait loop

(cherry picked from commit 8e7b138)

Co-authored-by: Miguel Grinberg <miguel.grinberg@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 8.x Backport to 8.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent handling of empty lists in Document partial updates.
2 participants