docstr: Get the oldest job that is ready to be triggered by trigger time
  Arguments:
      only_past_jobs (bool): boolean flag to denote if only jobs with trigger time in
          past should be considered
  Returns:
      Returns the first job to be triggered
docstr_tok: ["Get","the","oldest","job","that","is","ready","to","be","triggered","by","trigger","time","Arguments",":","only_past_jobs","(","bool",")",":","boolean","flag","to","denote","if","only","jobs","with","trigger","time","in","past","should","be","considered","Returns",":","Returns","the","first","job","to","be","triggered"]
code: def get_next_executable_job(
      self, only_past_jobs: bool
  ) -> JobCatalogEntry:
      """Get the oldest job that is ready to be triggered by trigger time
      Arguments:
          only_past_jobs (bool): boolean flag to denote if only jobs with trigger time in
              past should be considered
      Returns:
          Returns the first job to be triggered
      """
      entry = self.session.execute(
          select(self.model)
          .filter(
              and_(
                  self.model._next_scheduled_run
                  <= datetime.datetime.now(),
                  self.model._active == true(),
              )
              if only_past_jobs
              else self.model._active == true()
          )
          .order_by(self.model._next_scheduled_run.asc())
          .limit(1)
      ).scalar_one_or_none()
      if entry:
          return entry.as_dataclass()
      return entry
  
file_path: evadb/evadb/catalog/services/job_catalog_service.py
imports: import datetime
  import json
  from sqlalchemy import and_, true
  from sqlalchemy.orm import Session
  from sqlalchemy.sql.expression import select
  from evadb.catalog.models.job_catalog import JobCatalog
  from evadb.catalog.models.utils import JobCatalogEntry
  from evadb.catalog.services.base_service import BaseService
  from evadb.utils.errors import CatalogError
  from evadb.utils.logging_manager import logger
label_desc: Use image node_id 6 for calling the JobCatalogService obj's underlying member method code with example usage: obj.get_next_executable_job(only_past_jobs) and returns: entry, entry