Dylan Hunt
01/21/2022, 1:37 PMdaniel
01/21/2022, 3:28 PMreconstructable
function for this: https://docs.dagster.io/_apidocs/execution#dagster.reconstructableDylan Hunt
01/21/2022, 3:58 PMreconstructable
function. I tried a decorated pipeline function with reconstructable
and it works as expected. Now how I can reconstruct the PipelineDefinition class ?prha
01/21/2022, 4:18 PMreconstructable
function can also accept functions that produce a PipelineDefinition. So you can try passing in a lambda or creating a wrapping function around your PipelineDefinition.
def build_my_pipeline_def():
return PipelineDefinition(...)
my_reconstructable_pipeline = reconstructable(build_my_pipeline_def)
Dylan Hunt
01/21/2022, 4:22 PMexecute_pipeline( pipeline=reconstructable(construct_pipeline(pipeline, solids)), run_config=configurations, instance=DagsterInstance.local_temp())
daniel
01/21/2022, 4:23 PMDylan Hunt
01/21/2022, 4:24 PMdaniel
01/21/2022, 4:25 PMDylan Hunt
01/21/2022, 4:25 PMprha
01/21/2022, 4:35 PMmy_pipeline_fn = lambda: construct_pipeline(pipeline, solids)
execute_pipeline(pipeline=reconstructable(my_pipeline_fn), ...)
Dylan Hunt
01/21/2022, 4:41 PMReconstructable target can not be a lambda. Use a function or decorated function defined at module scope instead, or use build_reconstructable_target.
prha
01/21/2022, 4:41 PMdef my_pipeline_fn():
return construct_pipeline(pipeline, solids):
Dylan Hunt
01/21/2022, 5:06 PMReconstructable target "build_pipeline" has a different __qualname__ "SomeClass.some_func.<locals>.build_pipeline" indicating it is not defined at module scope. Use a function or decorated function defined at module scope instead, or use build_reconstructable_pipeline.
prha
01/21/2022, 5:14 PMbuild_reconstructable_pipeline
is pretty good. It allows for JSON-serializable arguments in addition to the pipeline factory name: https://docs.dagster.io/_apidocs/pipeline#dagster.core.definitions.reconstructable.build_reconstructable_pipeline