Ejemplo n.º 1
0
def get_pipeline_snapshot(graphene_info, snapshot_id):
    check.str_param(snapshot_id, 'snapshot_id')
    historical_pipeline = graphene_info.context.instance.get_historical_pipeline(
        snapshot_id)
    # Check is ok because this is only used for pipelineSnapshot which is for adhoc
    # In fact we should probably delete all the non OrError fields
    check.invariant(historical_pipeline, 'Pipeline fetch failed')
    return DauphinPipelineSnapshot(historical_pipeline)
Ejemplo n.º 2
0
def get_pipeline_snapshot_or_error_from_pipeline_name(graphene_info,
                                                      pipeline_name):
    check.str_param(pipeline_name, 'pipeline_name')
    return DauphinPipelineSnapshot(
        get_full_external_pipeline_or_raise(
            graphene_info,
            PipelineSelector.legacy(graphene_info.context,
                                    pipeline_name,
                                    solid_subset=None),
        ))
Ejemplo n.º 3
0
def _get_dauphin_pipeline_snapshot_from_instance(instance, snapshot_id):
    from dagster_graphql.schema.errors import DauphinPipelineSnapshotNotFoundError

    if not instance.has_pipeline_snapshot(snapshot_id):
        raise UserFacingGraphQLError(DauphinPipelineSnapshotNotFoundError(snapshot_id))

    pipeline_snapshot = instance.get_pipeline_snapshot(snapshot_id)

    if not pipeline_snapshot:
        # Either a temporary error or it has been deleted in the interim
        raise UserFacingGraphQLError(DauphinPipelineSnapshotNotFoundError(snapshot_id))

    return DauphinPipelineSnapshot(PipelineIndex(pipeline_snapshot))
Ejemplo n.º 4
0
def get_pipeline_snapshot_or_error_from_pipeline_selector(
        graphene_info, pipeline_selector):
    check.inst_param(pipeline_selector, 'pipeline_selector', PipelineSelector)
    return DauphinPipelineSnapshot(
        get_full_external_pipeline_or_raise(graphene_info, pipeline_selector))
Ejemplo n.º 5
0
def get_pipeline_snapshot_or_error_from_pipeline_name(graphene_info, pipeline_name):
    check.str_param(pipeline_name, 'pipeline_name')
    pipeline_def = get_pipeline_definition(graphene_info, pipeline_name)
    return DauphinPipelineSnapshot(pipeline_def.get_pipeline_index())
Ejemplo n.º 6
0
def get_pipeline_snapshot(graphene_info, snapshot_id):
    check.str_param(snapshot_id, 'snapshot_id')
    pipeline_snapshot = graphene_info.context.instance.get_pipeline_snapshot(snapshot_id)
    return DauphinPipelineSnapshot(PipelineIndex(pipeline_snapshot))
Ejemplo n.º 7
0
def get_pipeline_snapshot_or_error(graphene_info, subset_id):
    check.str_param(subset_id, 'subset_id')
    selector = ExecutionSelector(subset_id)
    pipeline_def = get_dauphin_pipeline_from_selector(graphene_info, selector)
    return DauphinPipelineSnapshot(pipeline_def.get_pipeline_index())
Ejemplo n.º 8
0
def get_pipeline_snapshot_or_error_from_pipeline_name(graphene_info,
                                                      pipeline_name):
    check.str_param(pipeline_name, 'pipeline_name')
    return DauphinPipelineSnapshot(
        get_external_pipeline_or_raise(graphene_info,
                                       pipeline_name).pipeline_index)