code: def test_vectordatabase_parsing(vector_store_handler):
      # create a table
      # due to the limitation of the parser
      # we can only create a table with a select statement
      sql = """
          CREATE TABLE chroma_db.test_table (
              SELECT *
              FROM chroma_db.test_table
          )
      """
      query = parse_sql(sql, dialect="mindsdb")
      vector_store_handler._dispatch(query)
      vector_store_handler.create_table.assert_called_once()
      vector_store_handler.create_table.assert_called_with(
          "test_table", if_not_exists=False
      )
  
      # drop a table
      sql = """
          DROP TABLE chroma_db.test_table
      """
      query = parse_sql(sql, dialect="mindsdb")
      vector_store_handler._dispatch(query)
      vector_store_handler.drop_table.assert_called_once()
      vector_store_handler.drop_table.assert_called_with(
          "test_table", if_exists=False
      )
  
      # insert into a table
      sql = """
          INSERT INTO chroma_db.test_table (
              id,content,metadata,embeddings
          )
          VALUES (
              1, 'test', '{"some_field": "some_value"}', '[1,2,3]'
          ),
          (
              2, 'test', '{"some_field": "some_value"}', '[1,2,3]'
          )
      """
  
      data = pd.DataFrame(
          {
              "id": [1, 2],
              "content": ["test", "test"],
              "embeddings": [[1, 2, 3], [1, 2, 3]],
              "metadata": [
                  {"some_field": "some_value"},
                  {"some_field": "some_value"},
              ],
          }
      )
  
      query = parse_sql(sql, dialect="mindsdb")
      vector_store_handler._dispatch(query)
      vector_store_handler.insert.assert_called_once()
      # get the args passed to the insert method
      args, kwargs = vector_store_handler.insert.call_args
      # get the data passed to the insert method
      assert args[0] == "test_table"
      data = args[1]
      # assert the data is the same
      assert_frame_equal(data, data)
      assert kwargs["columns"] == [
          "id",
          "content",
          "metadata",
          "embeddings",
      ]
  
      # select from a table
      # select without filters
      sql = """
          SELECT *
          FROM chroma_db.test_table
      """
      query = parse_sql(sql, dialect="mindsdb")
      vector_store_handler._dispatch(query)
      vector_store_handler.select.assert_called_once()
      vector_store_handler.select.assert_called_with(
          "test_table",
          columns=["id", "content", "embeddings", "metadata"],
          conditions=None,
          offset=None,
          limit=None,
      )
      # select with search_vector filter
      sql = """
          SELECT *
          FROM chroma_db.test_table
          WHERE search_vector = '[1, 2, 3]'
          LIMIT 10
      """
      query = parse_sql(sql, dialect="mindsdb")
      # reset the mock
      vector_store_handler.select.reset_mock()
      vector_store_handler._dispatch(query)
      vector_store_handler.select.assert_called_once()
      vector_store_handler.select.assert_called_with(
          "test_table",
          columns=["id", "content", "embeddings", "metadata"],
          conditions=[
              FilterCondition(
                  column="search_vector",
                  op=FilterOperator.EQUAL,
                  value=[1, 2, 3],
              )
          ],
          limit=10,
          offset=None,
      )
  
      # select with limit and offset
      sql = """
          SELECT *
          FROM chroma_db.test_table
          LIMIT 10
          OFFSET 5
      """
      query = parse_sql(sql, dialect="mindsdb")
      # reset the mock
      vector_store_handler.select.reset_mock()
      vector_store_handler._dispatch(query)
      vector_store_handler.select.assert_called_once()
      vector_store_handler.select.assert_called_with(
          "test_table",
          columns=["id", "content", "embeddings", "metadata"],
          conditions=None,
          limit=10,
          offset=5,
      )
  
      # select with a subset of columns
      sql = """
          SELECT id, content
          FROM chroma_db.test_table
      """
      query = parse_sql(sql, dialect="mindsdb")
      # reset the mock
      vector_store_handler.select.reset_mock()
      vector_store_handler._dispatch(query)
      vector_store_handler.select.assert_called_once()
      vector_store_handler.select.assert_called_with(
          "test_table",
          columns=["id", "content"],
          conditions=None,
          limit=None,
          offset=None,
      )
  
      # select with metadata filter
      sql = """
          SELECT *
          FROM chroma_db.test_table
          WHERE metadata.created_at = '2021-01-01'
          AND metadata.some_field in ('some_value', 'some_other_value')
          AND search_vector = '[1, 2, 3]'
      """
      query = parse_sql(sql, dialect="mindsdb")
      # reset the mock
      vector_store_handler.select.reset_mock()
      vector_store_handler._dispatch(query)
      vector_store_handler.select.assert_called_once()
      vector_store_handler.select.assert_called_with(
          "test_table",
          columns=["id", "content", "embeddings", "metadata"],
          conditions=[
              FilterCondition(
                  column="metadata.created_at",
                  op=FilterOperator.EQUAL,
                  value="2021-01-01",
              ),
              FilterCondition(
                  column="metadata.some_field",
                  op=FilterOperator.IN,
                  value=["some_value", "some_other_value"],
              ),
              FilterCondition(
                  column="search_vector",
                  op=FilterOperator.EQUAL,
                  value=[1, 2, 3],
              ),
          ],
          limit=None,
          offset=None,
      )
  
      # delete from a table
      sql = """
          DELETE FROM chroma_db.test_table
          WHERE id = 1
      """
      query = parse_sql(sql, dialect="mindsdb")
      vector_store_handler._dispatch(query)
      vector_store_handler.delete.assert_called_once()
      vector_store_handler.delete.assert_called_with(
          "test_table",
          conditions=[
              FilterCondition(
                  column="id", op=FilterOperator.EQUAL, value=1
              )
          ],
      )
  
file_path: mindsdb/tests/handler_tests/test_vectordatabase_dispatch.py
imports: from unittest.mock import Mock
  import pandas
  import pytest
  from mindsdb_sql import parse_sql
  from pandas.testing import assert_frame_equal
  from mindsdb.integrations.libs.vectordatabase_handler import FilterCondition, FilterOperator, VectorStoreHandler
label_desc: Use image node_id 2 for calling a global function with example usage: test_vectordatabase_parsing(vector_store_handler) without return types