code: def _handle_non_dict(filters, previous_key):
      if previous_key not in ALL_LEGACY_OPERATORS_MAPPING:
          return {
              "field": previous_key,
              "operator": "==",
              "value": filters,
          }
      return filters
  
imports: from typing import List, Any, Union, Dict
  from dataclasses import fields
  from datetime import datetime
  import pandas
  from haystack.dataclasses import Document
  from haystack.errors import FilterError
label_desc: Use image node_id 18 for calling a global function with example usage: _handle_non_dict(filters, previous_key) and returns: filters, dict