Probably better to do:

```
elif val['_type'] in ('date_histogram', 'histogram'):
```