Exemplo n.º 1
0
 def resolve_executionPlan(self, graphene_info, pipeline, **kwargs):
     return get_execution_plan(
         graphene_info,
         pipeline.to_selector(),
         kwargs.get('environmentConfigData'),
         kwargs.get('mode'),
     )
Exemplo n.º 2
0
 def resolve_executionPlanOrError(self, graphene_info, pipeline, **kwargs):
     return get_execution_plan(
         graphene_info,
         pipeline_selector_from_graphql(graphene_info.context, pipeline),
         kwargs.get('runConfigData'),
         kwargs.get('mode'),
     )
Exemplo n.º 3
0
    def resolve_executionPlan(self, graphene_info):
        if (self._pipeline_run.execution_plan_snapshot_id
                and self._pipeline_run.pipeline_snapshot_id):
            from .execution import DauphinExecutionPlan

            instance = graphene_info.context.instance
            execution_plan_snapshot = instance.get_execution_plan_snapshot(
                self._pipeline_run.execution_plan_snapshot_id)
            pipeline_snapshot = instance.get_pipeline_snapshot(
                self._pipeline_run.pipeline_snapshot_id)
            return (DauphinExecutionPlan(
                ExecutionPlanIndex(
                    execution_plan_snapshot=execution_plan_snapshot,
                    pipeline_index=PipelineIndex(pipeline_snapshot),
                ))
                    # check this in case fetches fail
                    if execution_plan_snapshot and pipeline_snapshot else None)
        else:
            # "legacy" code path for runs created before pipeline and
            # execution plan snapshots.
            pipeline = self.resolve_pipeline(graphene_info)

            if isinstance(pipeline, DauphinPipeline):
                selector = self._pipeline_run.selector
                environment_dict = self._pipeline_run.environment_dict
                mode = self._pipeline_run.mode

                pipeline_def = get_pipeline_def_from_selector(
                    graphene_info, selector)
                if is_config_valid(pipeline_def, environment_dict, mode):
                    return get_execution_plan(graphene_info, selector,
                                              environment_dict, mode)

            return None
Exemplo n.º 4
0
    def resolve_executionPlan(self, graphene_info):
        pipeline = self.resolve_pipeline(graphene_info)

        if isinstance(pipeline, DauphinPipeline):
            selector = self._pipeline_run.selector
            environment_dict = self._pipeline_run.environment_dict
            mode = self._pipeline_run.mode

            pipeline_def = get_pipeline_def_from_selector(
                graphene_info, selector)
            if is_config_valid(pipeline_def, environment_dict, mode):
                return get_execution_plan(graphene_info, selector,
                                          environment_dict, mode)

        return None
Exemplo n.º 5
0
 def resolve_executionPlan(self, graphene_info, pipeline, config):
     return get_execution_plan(graphene_info, pipeline.to_selector(), config)