code: def test_get_filters_adhoc_filters() -> None:
      with app.test_request_context(
          data={
              "form_data": json.dumps(
                  {
                      "adhoc_filters": [
                          {
                              "clause": "WHERE",
                              "comparator": "foo",
                              "expressionType": "SIMPLE",
                              "operator": "in",
                              "subject": "name",
                          }
                      ],
                  }
              )
          }
      ):
          cache = ExtraCache()
          assert cache.get_filters("name") == [
              {"op": "IN", "col": "name", "val": ["foo"]}
          ]
  
          assert cache.removed_filters == []
          assert cache.applied_filters == ["name"]
  
      with app.test_request_context(
          data={
              "form_data": json.dumps(
                  {
                      "adhoc_filters": [
                          {
                              "clause": "WHERE",
                              "comparator": ["foo", "bar"],
                              "expressionType": "SIMPLE",
                              "operator": "in",
                              "subject": "name",
                          }
                      ],
                  }
              )
          }
      ):
          cache = ExtraCache()
          assert cache.get_filters("name") == [
              {"op": "IN", "col": "name", "val": ["foo", "bar"]}
          ]
          assert cache.removed_filters == []
  
      with app.test_request_context(
          data={
              "form_data": json.dumps(
                  {
                      "adhoc_filters": [
                          {
                              "clause": "WHERE",
                              "comparator": ["foo", "bar"],
                              "expressionType": "SIMPLE",
                              "operator": "in",
                              "subject": "name",
                          }
                      ],
                  }
              )
          }
      ):
          cache = ExtraCache()
          assert cache.get_filters("name", remove_filter=True) == [
              {"op": "IN", "col": "name", "val": ["foo", "bar"]}
          ]
          assert cache.removed_filters == ["name"]
          assert cache.applied_filters == ["name"]
  
imports: import json
  from typing import Any
  import pytest
  from sqlalchemy.dialects.postgresql import dialect
  from superset import app
  from superset.exceptions import SupersetTemplateException
  from superset.jinja_context import ExtraCache, safe_proxy
label_desc: Use image node_id 6 for calling a global function with example usage: test_get_filters_adhoc_filters() without return types