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

Regression: source() does not accept iterables #1893

Closed
realsuayip opened this issue Sep 2, 2024 · 1 comment · Fixed by #1895
Closed

Regression: source() does not accept iterables #1893

realsuayip opened this issue Sep 2, 2024 · 1 comment · Fixed by #1895
Labels
Category: Bug Something isn't right Priority: High

Comments

@realsuayip
Copy link

realsuayip commented Sep 2, 2024

Prior to the following change, I could pass a tuple to source() calls, e.g. source(includes=("a","b","c"))

https://github.com/elastic/elasticsearch-dsl-py/pull/1845/files#diff-706d55be3a1b925b14bb3122ccecf00daeb04113df622f4ce445bec7d7753f5cR627

Seems like passing tuples, or any other iterable other than lists will now fail due to isinstance(fields, list) check.

Notice that this was before the typing update, which established the parameter type as list. This change at least needs to be documented if we are not considering supporting other collection types.

@miguelgrinberg
Copy link
Collaborator

This is unintended, I'll improve the logic to allow all iterables and not just lists. Thanks!

miguelgrinberg added a commit to miguelgrinberg/elasticsearch-dsl-py that referenced this issue Sep 3, 2024
github-actions bot pushed a commit that referenced this issue Sep 3, 2024
* Allow tuples and other iterables in source() method

Fixes #1893

* review feedback

(cherry picked from commit 6853db7)
miguelgrinberg added a commit that referenced this issue Sep 3, 2024
* Allow tuples and other iterables in source() method

Fixes #1893

* review feedback

(cherry picked from commit 6853db7)

Co-authored-by: Miguel Grinberg <miguel.grinberg@gmail.com>
miguelgrinberg added a commit to miguelgrinberg/elasticsearch-dsl-py that referenced this issue Dec 9, 2024
* Allow tuples and other iterables in source() method

Fixes elastic#1893

* review feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Bug Something isn't right Priority: High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants