code: def query(self, query=None, native_query=None, session=None):
      if query is None and native_query is not None:
          query = parse_sql(native_query, dialect="mindsdb")
  
      if isinstance(query, Update):
          query_table = query.table.parts[0].lower()
          kb_table = session.kb_controller.get_table(
              query_table, self.project.id
          )
          if kb_table:
              # this is the knowledge db
              kb_table.update_query(query)
              return pd.DataFrame(), []
  
          raise NotImplementedError(
              f"Can't update object: {query_table}"
          )
  
      elif isinstance(query, Delete):
          query_table = query.table.parts[0].lower()
          kb_table = session.kb_controller.get_table(
              query_table, self.project.id
          )
          if kb_table:
              # this is the knowledge db
              kb_table.delete_query(query)
              return pd.DataFrame(), []
  
          raise NotImplementedError(
              f"Can't delete object: {query_table}"
          )
  
      elif isinstance(query, Select):
          # region is it query to 'models' or 'models_versions'?
          query_table = query.from_table.parts[0].lower()
          # region FIXME temporary fix to not broke queries to 'mindsdb.models'. Can be deleted it after 1.12.2022
          if query_table == "predictors":
              query.from_table.parts[0] = "models"
              query_table = "models"
          # endregion
          if query_table in (
              "models",
              "models_versions",
              "jobs",
              "jobs_history",
              "mdb_triggers",
              "chatbots",
              "skills",
              "agents",
          ):
              new_query = deepcopy(query)
              project_filter = BinaryOperation(
                  "=",
                  args=[
                      Identifier("project"),
                      Constant(self.project.name),
                  ],
              )
              if new_query.where is None:
                  new_query.where = project_filter
              else:
                  new_query.where = BinaryOperation(
                      "and", args=[new_query.where, project_filter]
                  )
              data, columns_info = self.information_schema.query(
                  new_query
              )
              return data, columns_info
          # endregion
  
          # other table from project
  
          if self.project.get_view(query_table):
              # this is the view
  
              view_meta = self.project.query_view(query)
  
              query_context_controller.set_context(
                  "view", view_meta["id"]
              )
  
              try:
                  sqlquery = SQLQuery(
                      view_meta["query_ast"], session=session
                  )
                  result = sqlquery.fetch(view="dataframe")
  
              finally:
                  query_context_controller.release_context(
                      "view", view_meta["id"]
                  )
  
              if result["success"] is False:
                  raise Exception(
                      f"Cant execute view query: {view_meta['query_ast']}"
                  )
              df = result["result"]
  
              df = query_df(df, query)
  
              columns_info = [
                  {"name": k, "type": v} for k, v in df.dtypes.items()
              ]
  
              return df.to_dict(orient="records"), columns_info
  
          kb_table = session.kb_controller.get_table(
              query_table, self.project.id
          )
          if kb_table:
              # this is the knowledge db
              df = kb_table.select_query(query)
              columns_info = [
                  {"name": k, "type": v} for k, v in df.dtypes.items()
              ]
  
              return df.to_dict(orient="records"), columns_info
  
          raise EntityNotExistsError(
              f"Can't select from {query_table} in project"
          )
      else:
          raise NotImplementedError(f"Query not supported {query}")
  
file_path: mindsdb/mindsdb/api/executor/datahub/datanodes/project_datanode.py
imports: from copy import deepcopy
  import pandas
  from mindsdb_sql import parse_sql
  from mindsdb_sql.parser.ast import BinaryOperation, Identifier, Constant, Update, Select, Delete
  from mindsdb.utilities.exception import EntityNotExistsError
  from mindsdb.api.executor.datahub.datanodes.datanode import DataNode
  from mindsdb.api.executor.datahub.classes.tables_row import TablesRow
  from mindsdb.api.executor import SQLQuery
  from mindsdb.api.executor.utilities.sql import query_df
  from mindsdb.interfaces.query_context.context_controller import query_context_controller
label_desc: Use image node_id 7 for calling the ProjectDataNode obj's underlying member method code with example usage: obj.query(query, native_query, session) and returns: pd,  list, pd,  list, data,  columns_info, df,  columns_info, df,  columns_info