class_docstr: This handler handles connection and execution of the Pinecone statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","Pinecone","statements","."]
docstr: Run query on pinecone index named `table_name` and get results.
docstr_tok: ["Run","query","on","pinecone","index","named","`","table_name","`","and","get","results","."]
code: def select(
      self,
      table_name: str,
      columns: List[str] = None,
      conditions: List[FilterCondition] = None,
      offset: int = None,
      limit: int = None,
  ) -> HandlerResponse:
      """Run query on pinecone index named `table_name` and get results."""
      index = self._get_index_handle(table_name)
      if index is None:
          return Response(
              resp_type=RESPONSE_TYPE.ERROR,
              error_message=f"Error getting index '{table_name}', are you sure the name is correct?",
          )
      query = {"include_values": True, "include_metadata": True}
      # check for metadata filter
      metadata_filters = self._translate_metadata_condition(conditions)
      # check for vector filter
      vector_filter = (
          None
          if conditions is None
          else [
              condition.value
              for condition in conditions
              if condition.column == TableField.SEARCH_VECTOR.value
          ]
      )
      if vector_filter:
          if len(vector_filter) > 1:
              return Response(
                  resp_type=RESPONSE_TYPE.ERROR,
                  error_message="You cannot have multiple search_vectors in query",
              )
          query["vector"] = vector_filter[0]
          # For subqueries, the vector filter is a list of list of strings
          if isinstance(query["vector"], list) and isinstance(
              query["vector"][0], str
          ):
              if len(query["vector"]) > 1:
                  return Response(
                      resp_type=RESPONSE_TYPE.ERROR,
                      error_message="You cannot have multiple search_vectors in query",
                  )
              try:
                  query["vector"] = ast.literal_eval(query["vector"][0])
              except Exception as e:
                  return Response(
                      resp_type=RESPONSE_TYPE.ERROR,
                      error_message=f"Cannot parse the search vector '{query['vector']}'into a list: {e}",
                  )
      # check for limit
      if limit is not None:
          query["top_k"] = limit
      else:
          query["top_k"] = self.MAX_FETCH_LIMIT
      if metadata_filters is not None:
          query["filter"] = metadata_filters
      # check for id filter
      id_filters = None
      if conditions is not None:
          id_filters = [
              condition.value
              for condition in conditions
              if condition.column == TableField.ID.value
          ] or None
      if id_filters:
          if len(id_filters) > 1:
              return Response(
                  resp_type=RESPONSE_TYPE.ERROR,
                  error_message="You cannot have multiple IDs in query",
              )
          query["id"] = id_filters[0]
      # exec query
      result = None
      try:
          result = index.query(**query)
      except Exception as e:
          return Response(
              resp_type=RESPONSE_TYPE.ERROR,
              error_message=f"Error running SELECT query on '{table_name}': {e}",
          )
      # convert to dataframe
      df_columns = {
          "id": TableField.ID.value,
          "metadata": TableField.METADATA.value,
          "values": TableField.EMBEDDINGS.value,
      }
      results_df = pd.DataFrame.from_records(
          self._matches_to_dicts(result["matches"])
      )
      if bool(len(results_df.columns)):
          results_df.rename(columns=df_columns, inplace=True)
      else:
          results_df = pd.DataFrame(columns=list(df_columns.values()))
      results_df[TableField.CONTENT.value] = ""
      return Response(
          resp_type=RESPONSE_TYPE.TABLE, data_frame=results_df[columns]
      )
  
imports: from collections import OrderedDict
  from typing import List, Optional
  import pinecone
  import pandas
  import ast
  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 15 for calling the PineconeHandler obj's underlying member method code with example usage: obj.select(table_name, columns, conditions, offset, limit) and returns: Response, Response, Response, Response, Response, Response, Response