elastic / elasticsearch-dsl-py

High level Python client for Elasticsearch
http://elasticsearch-dsl.readthedocs.org
Apache License 2.0
3.84k stars 802 forks source link

Regression: source() does not accept iterables #1893

Closed realsuayip closed 2 months ago

realsuayip commented 2 months ago

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 commented 2 months ago

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