class_docstr: Jira Projects Table implementation
docstr: Pulls data from the Jira "get_all_project_issues" API endpoint
  Parameters
  ----------
  query : ast.Select
     Given SQL SELECT query
  Returns
  -------
  pd.DataFrame
      jira "get_all_project_issues" matching the query
  Raises
  ------
  ValueError
      If the query contains an unsupported condition
docstr_tok: ["Pulls","data","from","the","Jira","``","get_all_project_issues","''","API","endpoint","Parameters","--","--","--","--","--","query",":","ast.Select","Given","SQL","SELECT","query","Returns","--","--","--","-","pd.DataFrame","jira","``","get_all_project_issues","''","matching","the","query","Raises","--","--","--","ValueError","If","the","query","contains","an","unsupported","condition"]
code: def select(self, query: ast.Select) -> pd.DataFrame:
      """Pulls data from the Jira "get_all_project_issues" API endpoint
      Parameters
      ----------
      query : ast.Select
         Given SQL SELECT query
      Returns
      -------
      pd.DataFrame
          jira "get_all_project_issues" matching the query
      Raises
      ------
      ValueError
          If the query contains an unsupported condition
      """
      conditions = extract_comparison_conditions(query.where)
  
      if query.limit:
          total_results = query.limit.value
  
      issues_kwargs = {}
      order_by_conditions = {}
  
      if query.order_by and len(query.order_by) > 0:
          order_by_conditions["columns"] = []
          order_by_conditions["ascending"] = []
  
          for an_order in query.order_by:
              if an_order.field.parts[0] != "key":
                  continue
              if an_order.field.parts[1] in [
                  "reporter",
                  "assignee",
                  "status",
              ]:
                  if issues_kwargs != {}:
                      raise ValueError(
                          "Duplicate order conditions found for reporter,status and assignee"
                      )
                  issues_kwargs["sort"] = an_order.field.parts[1]
                  issues_kwargs["direction"] = an_order.direction
              if an_order.field.parts[1] in self.get_columns():
                  order_by_conditions["columns"].append(
                      an_order.field.parts[1]
                  )
  
                  if an_order.direction == "ASC":
                      order_by_conditions["ascending"].append(True)
                  else:
                      order_by_conditions["ascending"].append(False)
              else:
                  raise ValueError(
                      f"Order by unknown column {an_order.field.parts[1]}"
                  )
      project = self.handler.connection_data["project"]
      jira_project_df = self.call_jira_api(project)
  
      selected_columns = []
      for target in query.targets:
          if isinstance(target, ast.Star):
              selected_columns = self.get_columns()
              break
          elif isinstance(target, ast.Identifier):
              selected_columns.append(target.parts[-1])
          else:
              raise ValueError(f"Unknown query target {type(target)}")
  
      if len(jira_project_df) == 0:
          jira_project_df = pd.DataFrame([], columns=selected_columns)
          return jira_project_df
  
      jira_project_df.columns = self.get_columns()
      for col in set(jira_project_df.columns).difference(
          set(selected_columns)
      ):
          jira_project_df = jira_project_df.drop(col, axis=1)
  
      if len(order_by_conditions.get("columns", [])) > 0:
          jira_project_df = jira_project_df.sort_values(
              by=order_by_conditions["columns"],
              ascending=order_by_conditions["ascending"],
          )
  
      if query.limit:
          jira_project_df = jira_project_df.head(total_results)
  
      return jira_project_df
  
file_path: mindsdb/mindsdb/integrations/handlers/jira_handler/jira_table.py
imports: import pandas
  from typing import List
  from mindsdb.integrations.libs.api_handler import APITable
  from mindsdb.integrations.utilities.sql_utils import extract_comparison_conditions
  from mindsdb.utilities import log
  from mindsdb_sql.parser import ast
label_desc: Use image node_id 1 for calling the JiraProjectsTable obj's underlying member method code with example usage: obj.select(query) and returns: jira_project_df, jira_project_df