Example #1
0
def get_used_solid_map(graphene_info):
    repository_index = graphene_info.context.get_repository_index()
    inv_by_def_name = defaultdict(list)
    definitions = []

    for pipeline_index in repository_index.get_pipeline_indices():
        for handle in build_dauphin_solid_handles(
                pipeline_index, pipeline_index.dep_structure_index):
            definition = handle.solid.get_dauphin_solid_definition()
            if definition.name not in inv_by_def_name:
                definitions.append(definition)
            inv_by_def_name[definition.name].append(
                DauphinSolidInvocationSite(
                    pipeline=get_dauphin_pipeline_from_pipeline_index(
                        graphene_info, pipeline_index),
                    solidHandle=handle,
                ))
    return OrderedDict((
        definition.name,
        DauphinUsedSolid(
            definition=definition,
            invocations=sorted(inv_by_def_name[definition.name],
                               key=lambda i: i.solidHandle.handleID),
        ),
    ) for definition in sorted(definitions, key=lambda d: d.name))
Example #2
0
def get_used_solid_map(repo):
    check.inst_param(repo, "repo", ExternalRepository)

    inv_by_def_name = defaultdict(list)
    definitions = []

    for external_pipeline in repo.get_all_external_pipelines():
        for handle in build_dauphin_solid_handles(
            external_pipeline, external_pipeline.dep_structure_index
        ):
            definition = handle.solid.get_dauphin_solid_definition()
            if definition.name not in inv_by_def_name:
                definitions.append(definition)
            inv_by_def_name[definition.name].append(
                DauphinSolidInvocationSite(
                    pipeline=DauphinPipeline(external_pipeline), solidHandle=handle,
                )
            )

    return OrderedDict(
        (
            definition.name,
            DauphinUsedSolid(
                definition=definition,
                invocations=sorted(
                    inv_by_def_name[definition.name],
                    key=lambda i: i.solidHandle.handleID.to_string(),
                ),
            ),
        )
        for definition in sorted(definitions, key=lambda d: d.name)
    )
Example #3
0
def get_used_solid_map(graphene_info):
    inv_by_def_name = defaultdict(list)
    definitions = []

    for external_pipeline in graphene_info.context.get_all_external_pipelines(
    ):
        for handle in build_dauphin_solid_handles(
                external_pipeline, external_pipeline.dep_structure_index):
            definition = handle.solid.get_dauphin_solid_definition()
            if definition.name not in inv_by_def_name:
                definitions.append(definition)
            inv_by_def_name[definition.name].append(
                DauphinSolidInvocationSite(
                    pipeline=DauphinPipeline(external_pipeline),
                    solidHandle=handle,
                ))
    return OrderedDict((
        definition.name,
        DauphinUsedSolid(
            definition=definition,
            invocations=sorted(inv_by_def_name[definition.name],
                               key=lambda i: i.solidHandle.handleID),
        ),
    ) for definition in sorted(definitions, key=lambda d: d.name))