Alexis
04/16/2021, 10:50 AMalex
04/16/2021, 2:24 PMusing the same solidsif you are attempting to use the same solid definition - you just need to make sure you are using the same definition object instance
Alexis
04/16/2021, 2:48 PMdagster.SolidDefinition
instead of a @dagster.solid
? How would one do that ?alex
04/16/2021, 4:21 PM@solid
makes a SolidDefinition
f I were to remove the “name” argumentwhat are you passing name to in this context?
@solid
? Might be useful to send a small code snippetAlexis
04/16/2021, 4:56 PMclass SimpleProcessor(BaseProcessor, ABC):
@classmethod
def definition(cls, name: Optional[str] = None) -> SolidDefinition:
return solid(
name=name if name is not None else cls.info.name,
description=cls.info.description,
input_defs=cls._input_defs,
output_defs=cls._output_defs,
config_schema=cls._config_schema,
)(cls._algorithm)
And then this is called this way in two different pipelines:
result = SimpleProcessor.definition(
"signal_filter"
)(signal=signal)
name
to solid and then calling the resulting SolidDefinition
with an argument once in the first pipeline and once in the second pipeline, do I have to give them different names for them to be in the same repository ? Thanks I really appreciate your helpalex
04/16/2021, 5:46 PM@lru_cache
.class SimpleProcessor(BaseProcessor, ABC):
@classmethod
def definition(cls, name: Optional[str] = None) -> SolidDefinition:
if name not in cls._cached_solids:
cls._cached_solids[name] = solid(
name=name if name is not None else cls.info.name,
description=cls.info.description,
input_defs=cls._input_defs,
output_defs=cls._output_defs,
config_schema=cls._config_schema,
)(cls._algorithm)
return cls._cached_solids[name]
Alexis
04/16/2021, 7:24 PM