Changeset View
Changeset View
Standalone View
Standalone View
python_modules/dagster/dagster/core/definitions/dependency.py
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | class Solid(object): | ||||
Attributes: | Attributes: | ||||
name (str): | name (str): | ||||
Name of the solid inside the pipeline. Must be unique per-pipeline. | Name of the solid inside the pipeline. Must be unique per-pipeline. | ||||
definition (SolidDefinition): | definition (SolidDefinition): | ||||
Definition of the solid. | Definition of the solid. | ||||
""" | """ | ||||
def __init__(self, name, definition, container_definition=None, tags=None, hook_defs=None): | def __init__(self, name, definition, container_definition=None, tags=None, hook_defs=None): | ||||
from .pipeline import PipelineDefinition | |||||
from .solid import ISolidDefinition, CompositeSolidDefinition | from .solid import ISolidDefinition, CompositeSolidDefinition | ||||
self.name = check.str_param(name, "name") | self.name = check.str_param(name, "name") | ||||
self.definition = check.inst_param(definition, "definition", ISolidDefinition) | self.definition = check.inst_param(definition, "definition", ISolidDefinition) | ||||
self.container_definition = check.opt_inst_param( | self.container_definition = check.opt_inst_param( | ||||
container_definition, "container_definition", CompositeSolidDefinition | container_definition, | ||||
"container_definition", | |||||
(CompositeSolidDefinition, PipelineDefinition), | |||||
schrockn: will codemode container_definition across the codebase to graph_definition in followup | |||||
) | ) | ||||
self._additional_tags = validate_tags(tags) | self._additional_tags = validate_tags(tags) | ||||
self._hook_defs = check.opt_set_param(hook_defs, "hook_defs", of_type=HookDefinition) | self._hook_defs = check.opt_set_param(hook_defs, "hook_defs", of_type=HookDefinition) | ||||
input_handles = {} | input_handles = {} | ||||
for name, input_def in self.definition.input_dict.items(): | for name, input_def in self.definition.input_dict.items(): | ||||
input_handles[name] = SolidInputHandle(self, input_def) | input_handles[name] = SolidInputHandle(self, input_def) | ||||
Show All 28 Lines | class Solid(object): | ||||
def has_output(self, name): | def has_output(self, name): | ||||
return self.definition.has_output(name) | return self.definition.has_output(name) | ||||
def output_def_named(self, name): | def output_def_named(self, name): | ||||
return self.definition.output_def_named(name) | return self.definition.output_def_named(name) | ||||
@property | @property | ||||
def is_composite(self): | def is_composite(self): | ||||
from .pipeline import PipelineDefinition | |||||
from .solid import CompositeSolidDefinition | from .solid import CompositeSolidDefinition | ||||
return isinstance(self.definition, CompositeSolidDefinition) | return isinstance(self.definition, (CompositeSolidDefinition, PipelineDefinition)) | ||||
@property | @property | ||||
def input_dict(self): | def input_dict(self): | ||||
return self.definition.input_dict | return self.definition.input_dict | ||||
@property | @property | ||||
def output_dict(self): | def output_dict(self): | ||||
return self.definition.output_dict | return self.definition.output_dict | ||||
▲ Show 20 Lines • Show All 509 Lines • Show Last 20 Lines |
will codemode container_definition across the codebase to graph_definition in followup