class_docstr: This handler handles connection and execution of the Xata statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","Xata","statements","."]
docstr: Translate a list of FilterCondition objects a dict that can be used by Xata for filtering.
  E.g.,
  [
      FilterCondition(
          column="metadata.price",
          op=FilterOperator.LESS_THAN,
          value=100,
      ),
      FilterCondition(
          column="metadata.price",
          op=FilterOperator.GREATER_THAN,
          value=10,
      )
  ]
  -->
  {
      "metadata->price" {
          "$gt": 10,
          "$lt": 100
      },
  }
docstr_tok: ["Translate","a","list","of","FilterCondition","objects","a","dict","that","can","be","used","by","Xata","for","filtering",".","E.g.",",","[","FilterCondition","(","column=","''","metadata.price","''",",","op=FilterOperator.LESS_THAN",",","value=100",",",")",",","FilterCondition","(","column=","''","metadata.price","''",",","op=FilterOperator.GREATER_THAN",",","value=10",",",")","]","--",">","{","``","metadata-",">","price","''","{","``","$","gt","''",":","10",",","``","$","lt","''",":","100","}",",","}"]
code: def _translate_non_vector_conditions(
      self, conditions: List[FilterCondition]
  ) -> Optional[dict]:
      """
      Translate a list of FilterCondition objects a dict that can be used by Xata for filtering.
      E.g.,
      [
          FilterCondition(
              column="metadata.price",
              op=FilterOperator.LESS_THAN,
              value=100,
          ),
          FilterCondition(
              column="metadata.price",
              op=FilterOperator.GREATER_THAN,
              value=10,
          )
      ]
      -->
      {
          "metadata->price" {
              "$gt": 10,
              "$lt": 100
          },
      }
      """
      if not conditions:
          return None
      # Translate metadata columns
      for condition in conditions:
          if condition.column.startswith(TableField.METADATA.value):
              condition.column = condition.column.replace(".", "->")
      # Generate filters
      filters = {}
      for condition in conditions:
          # Skip search vector condition
          if condition.column == TableField.SEARCH_VECTOR.value:
              continue
          current_filter = original_filter = {}
          # Special case LIKE: needs pattern translation
          if condition.op == FilterOperator.LIKE:
              condition.value = condition.value.replace(
                  "%", "*"
              ).replace("_", "?")
          # Generate substatment
          current_filter[condition.column] = {
              self._get_xata_operator(condition.op): condition.value
          }
          # Check for conflicting and insert
          for key in original_filter:
              if key in filters:
                  filters[key] = {
                      **filters[key],
                      **original_filter[key],
                  }
              else:
                  filters = {**filters, **original_filter}
      return filters if filters else None
  
imports: from collections import OrderedDict
  from typing import List, Optional
  import pandas
  import json
  import xata
  from xata.helpers import BulkProcessor
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  from mindsdb.integrations.libs.response import RESPONSE_TYPE
  from mindsdb.integrations.libs.response import HandlerResponse
  from mindsdb.integrations.libs.response import HandlerResponse
  from mindsdb.integrations.libs.response import HandlerStatusResponse
  from mindsdb.integrations.libs.vectordatabase_handler import FilterCondition, FilterOperator, TableField, VectorStoreHandler
  from mindsdb.utilities import log
label_desc: Use image node_id 13 for calling the XataHandler obj's underlying member method code with example usage: obj._translate_non_vector_conditions(conditions) and returns: unknown, None