Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster/dagster/core/definitions/repository.py
Show First 20 Lines • Show All 543 Lines • ▼ Show 20 Lines | class RepositoryData: | ||||
def _construct_solid_defs(self): | def _construct_solid_defs(self): | ||||
solid_defs = {} | solid_defs = {} | ||||
solid_to_pipeline = {} | solid_to_pipeline = {} | ||||
# This looks like it should infinitely loop but the | # This looks like it should infinitely loop but the | ||||
# memoization of _all_pipelines and _all_solids short | # memoization of _all_pipelines and _all_solids short | ||||
# circuits that | # circuits that | ||||
for pipeline in self.get_all_pipelines(): | for pipeline in self.get_all_pipelines(): | ||||
for solid_def in pipeline.all_solid_defs: | for solid_def in pipeline.all_solid_defs + [pipeline.graph]: | ||||
if solid_def.name not in solid_defs: | if solid_def.name not in solid_defs: | ||||
solid_defs[solid_def.name] = solid_def | solid_defs[solid_def.name] = solid_def | ||||
solid_to_pipeline[solid_def.name] = pipeline.name | solid_to_pipeline[solid_def.name] = pipeline.name | ||||
if not solid_defs[solid_def.name] is solid_def: | if not solid_defs[solid_def.name] is solid_def: | ||||
first_name, second_name = sorted( | first_name, second_name = sorted( | ||||
[solid_to_pipeline[solid_def.name], pipeline.name] | [solid_to_pipeline[solid_def.name], pipeline.name] | ||||
) | ) | ||||
raise DagsterInvalidDefinitionError( | raise DagsterInvalidDefinitionError( | ||||
( | ( | ||||
"Duplicate solids found in repository with name '{solid_def_name}'. " | f"Conflicting definitions found in repository with name '{solid_def.name}'. " | ||||
"Solid definition names must be unique within a repository. Solid is " | "Solid & Graph/CompositeSolid definition names must be unique within a " | ||||
"defined in pipeline '{first_pipeline_name}' and in pipeline " | f"repository. {solid_def.__class__.__name__} is defined in pipeline " | ||||
"'{second_pipeline_name}'." | f"'{first_name}' and in pipeline '{second_name}'." | ||||
).format( | |||||
solid_def_name=solid_def.name, | |||||
first_pipeline_name=first_name, | |||||
second_pipeline_name=second_name, | |||||
) | ) | ||||
) | ) | ||||
return solid_defs | return solid_defs | ||||
def solid_def_named(self, name): | def solid_def_named(self, name): | ||||
"""Get the solid with the given name in the repository. | """Get the solid with the given name in the repository. | ||||
▲ Show 20 Lines • Show All 168 Lines • Show Last 20 Lines |