https://dagster.io/ logo
p

Paul Wyatt

11/20/2020, 5:42 PM
Is there a way to run a pipeline with hooks applied as reconstructable? When attempting to do so I see
dagster.core.errors.DagsterInvariantViolationError: Reconstructable target should be a function or definition produced by a decorated function, got <class 'dagster.core.definitions.pipeline.PipelineDefinition'>
The use case is writing tests for hook-decorated pipelines. Another potentially workable solution would be if hooks could be applied as part of an
execute_pipeline
call.
a

alex

11/20/2020, 5:43 PM
hmm this seems like a bug
easiest workaround is probably just adding a plain function that returns the pipeline and point reconstructable at that
Copy code
def get_pipeline():
  return my_pipeline
...
reconstructable(get_pipeline)
p

Paul Wyatt

11/20/2020, 6:32 PM
thanks. I'd like to actually run the test with the hooks applied. I have a workaround for the time being but I'll be watching the issue 😄
a

alex

11/20/2020, 7:07 PM
you should be able to run the test with the hooks applied with the approach described above