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 importing collapse from dict #1689

Merged
merged 1 commit into from
Dec 22, 2023
Merged

Conversation

miguelgrinberg
Copy link
Collaborator

Two minor bugs in the collapse implementation:

  • The cloning of the collapse key was in Request instead of Search
  • The collapse key was not importing from dict

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thank you! Looks great. One minor change left.

@@ -294,7 +294,6 @@ def _clone(self):
s = self.__class__(
using=self._using, index=self._index, doc_type=self._doc_type
)
s._collapse = self._collapse.copy()
Copy link
Member

Choose a reason for hiding this comment

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

Great catch, thanks! Can you please move self._collapse = {} to Search.__init__ too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the Search class already initializes self._collapse. The one in Request should not be there, I'm removing it.

Copy link
Member

@pquentin pquentin left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

@pquentin pquentin added the backport 8.x Backport to 8.x label Dec 22, 2023
@pquentin pquentin merged commit f0c5045 into elastic:main Dec 22, 2023
16 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 22, 2023
pquentin pushed a commit that referenced this pull request Dec 22, 2023
(cherry picked from commit f0c5045)

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.

2 participants