elastic / elasticsearch-dsl-py

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

TypeError: elasticsearch_dsl.aggs.A() got multiple values for keyword argument 'filter' #1902

Closed rikkt0r closed 1 month ago

rikkt0r commented 2 months ago

Error occures when accessing bucket aggregation containing a filter directly from AggBase derivate instead of .aggs dict.

The cause of this is the "filter" kwarg passed excessively, colliding with related aggregation params

Minimal sample to reproduce:

b = aggs.Filter(query.Terms(something=[1, 2, 3]))

a = aggs.Terms(field="some_field", size=100)
a.bucket("b", b)

a.aggs['b']  # Ok !
a['b']  # TypeError: elasticsearch_dsl.aggs.A() got multiple values for keyword argument 'filter'
rikkt0r commented 1 month ago

I'm closing this issue. The patch will arrive in the upcoming 8.15.3 release