# TypeError: unhashable type: "Term"

**URL:** <https://discuss.elastic.co/t/typeerror-unhashable-type-term/228594>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [April 17, 2020, 10:23pm UTC](https://discuss.elastic.co/t/typeerror-unhashable-type-term/228594 "2020-04-17T22:23:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![prasad98](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/prasad98/32/64837_2.png) [@prasad98](https://discuss.elastic.co/u/prasad98)\
**Post date:** [April 17, 2020, 10:23pm UTC](https://discuss.elastic.co/t/typeerror-unhashable-type-term/228594/1 "2020-04-17T22:23:54Z")

</div>

Hi, I'm working with elasticsearch-dsl package (version 2.5)

This is my query being formed with the help of elasticsearch-dsl package.

Python code for building query:

```auto
if self._filters:
    base = base.filter('bool', must=self._filters)

```

where `self._filters = []` is class constructor and it returns me this query:

```auto
{
    'must': 
        [
           Term(id=28300)
        ]
}

```

I'm facing some issues with it. There is some class in elasticsearch-dsl package like this:

```auto
Query.get_dsl_class(name_or_query)(**params)

```

and `get_dsl_class` method looks like this:

```auto
def get_dsl_class(cls, name):
    try:
        return cls._classes[name] <-- throwing error from here
    except KeyError:
        raise UnknownDslObject('DSL class `%s` does not exist in %s.' % (name, cls._type_name))

```

I'm getting this error: "TypeError: unhashable type: "Term"". I'm not sure how to fix it and wanted to have some context over it. It would be great if someone can help me with this issue, will really appreciate it. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 15, 2020, 10:23pm UTC](https://discuss.elastic.co/t/typeerror-unhashable-type-term/228594/2 "2020-05-15T22:23:54Z")

</div>

Closed on May 15, 2020, 10:23pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
