class_docstr: This handler handles connection and execution of the Weaviate statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","Weaviate","statements","."]
docstr: Translate a list of FilterCondition objects a dict that can be used by Weaviate.
  E.g.,
  [
      FilterCondition(
          column="metadata.created_at",
          op=FilterOperator.LESS_THAN,
          value="2020-01-01",
      ),
      FilterCondition(
          column="metadata.created_at",
          op=FilterOperator.GREATER_THAN,
          value="2019-01-01",
      )
  ]
  -->
  {"operator": "And",
  "operands": [
      {
          "path": ["created_at"],
          "operator": "LessThan",
          "valueText": "2020-01-01",
      },
      {
          "path": ["created_at"],
          "operator": "GreaterThan",
          "valueInt": "2019-01-01",
      },
  ]}
docstr_tok: ["Translate","a","list","of","FilterCondition","objects","a","dict","that","can","be","used","by","Weaviate",".","E.g.",",","[","FilterCondition","(","column=","''","metadata.created_at","''",",","op=FilterOperator.LESS_THAN",",","value=","''","2020-01-01","''",",",")",",","FilterCondition","(","column=","''","metadata.created_at","''",",","op=FilterOperator.GREATER_THAN",",","value=","''","2019-01-01","''",",",")","]","--",">","{","``","operator","''",":","``","And","''",",","''","operands","''",":","[","{","``","path","''",":","[","``","created_at","''","]",",","``","operator","''",":","``","LessThan","''",",","``","valueText","''",":","``","2020-01-01","''",",","}",",","{","``","path","''",":","[","``","created_at","''","]",",","``","operator","''",":","``","GreaterThan","''",",","``","valueInt","''",":","``","2019-01-01","''",",","}",",","]","}"]
code: def _translate_condition(
      self,
      table_name: str,
      conditions: List[FilterCondition] = None,
      meta_conditions: List[FilterCondition] = None,
  ) -> Optional[dict]:
      """
      Translate a list of FilterCondition objects a dict that can be used by Weaviate.
      E.g.,
      [
          FilterCondition(
              column="metadata.created_at",
              op=FilterOperator.LESS_THAN,
              value="2020-01-01",
          ),
          FilterCondition(
              column="metadata.created_at",
              op=FilterOperator.GREATER_THAN,
              value="2019-01-01",
          )
      ]
      -->
      {"operator": "And",
      "operands": [
          {
              "path": ["created_at"],
              "operator": "LessThan",
              "valueText": "2020-01-01",
          },
          {
              "path": ["created_at"],
              "operator": "GreaterThan",
              "valueInt": "2019-01-01",
          },
      ]}
      """
      table_name = table_name.capitalize()
      metadata_table_name = table_name.capitalize() + "_metadata"
      #
      if not (conditions or meta_conditions):
          return None
  
      # we translate each condition into a single dict
      #  conditions on columns
      weaviate_conditions = []
      if conditions:
          for condition in conditions:
              column_key = condition.column
              value_type = self._get_weaviate_value_type(
                  condition.value
              )
              weaviate_conditions.append(
                  {
                      "path": [column_key],
                      "operator": self._get_weaviate_operator(
                          condition.op
                      ),
                      value_type: condition.value,
                  }
              )
      # condition on metadata columns
      if meta_conditions:
          for condition in meta_conditions:
              meta_key = condition.column.split(".")[-1]
              value_type = self._get_weaviate_value_type(
                  condition.value
              )
              weaviate_conditions.append(
                  {
                      "path": [
                          "associatedMetadata",
                          metadata_table_name,
                          meta_key,
                      ],
                      "operator": self._get_weaviate_operator(
                          condition.op
                      ),
                      value_type: condition.value,
                  }
              )
  
      # we combine all conditions into a single dict
      all_conditions = (
          {"operator": "And", "operands": weaviate_conditions}
          # combining all conditions if there are more than one conditions
          if len(weaviate_conditions) > 1
          # only a single condition
          else weaviate_conditions[0]
      )
      return all_conditions
  
imports: from collections import OrderedDict
  from datetime import datetime
  from typing import List, Optional
  import weaviate
  from weaviate.embedded import EmbeddedOptions
  import pandas
  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
  from weaviate.util import generate_uuid5
label_desc: Use image node_id 9 for calling the WeaviateDBHandler obj's underlying member method code with example usage: obj._translate_condition(table_name, conditions, meta_conditions) and returns: all_conditions, None