Open
Description
Hi, consider the following document indexed on ES:
{'_id': 'id123',
'_index': 'index123',
'_source': {
'one_field': {'entries': []},
}
}
Calling to_dict(skip_empty=False)
on the corresponding DSL Document created out of it will return:
{"one_field": {}}
instead of
{"one_field": {"entries": []}}
After few tests, I believe the issue comes from the fact the serialize()
can sometimes call to_dict()
, without passing skip_empty
, ex: https://github.com/elastic/elasticsearch-dsl-py/blob/master/elasticsearch_dsl/field.py#L226
HTH. Thanks!