def resolve_runs(self, graphene_info, **kwargs): from .pipelines.pipeline import GrapheneRun filters = RunsFilter.for_backfill(self._backfill_job.backfill_id) return [ GrapheneRun(record) for record in graphene_info.context.instance.get_run_records( filters=filters, limit=kwargs.get("limit"), ) ]
def resolve_numRequested(self, graphene_info): filters = RunsFilter.for_backfill(self._backfill_job.backfill_id) run_count = graphene_info.context.instance.get_runs_count(filters) if self._backfill_job.status == BulkActionStatus.COMPLETED: return len(self._backfill_job.partition_names) checkpoint = self._backfill_job.last_submitted_partition_name return max( run_count, self._backfill_job.partition_names.index(checkpoint) + 1 if checkpoint and checkpoint in self._backfill_job.partition_names else 0, )