From 859449edae54a3932e4c2b35b0e076694800363b Mon Sep 17 00:00:00 2001 From: Joshua Zenn Date: Tue, 3 May 2022 10:43:48 -0400 Subject: [PATCH 1/2] #78 Stop pipeline if there are no more contexts --- watergrid/pipelines/pipeline.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/watergrid/pipelines/pipeline.py b/watergrid/pipelines/pipeline.py index e3a0e43..8fdce8b 100644 --- a/watergrid/pipelines/pipeline.py +++ b/watergrid/pipelines/pipeline.py @@ -133,6 +133,8 @@ def __run_pipeline_steps(self): contexts = [self.__generate_first_context()] for step in self._steps: contexts = self.__run_step_for_each_context(step, contexts) + if len(contexts) == 0: + break def __generate_first_context(self) -> DataContext: """ From f76164c9810ced1dd3e15b828debf8c8491924ee Mon Sep 17 00:00:00 2001 From: Joshua Zenn Date: Tue, 3 May 2022 10:46:30 -0400 Subject: [PATCH 2/2] #78 Stop pipeline fix added to changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c02f704..9185da2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ now be installed separately through `watergrid[...]` metapackages. (#54) - Resolved issue with objects inside a `DataContext` not being copied when the output mode of a step is set to `SPLIT`. (#6) +- Pipeline now stops running if there are no more contexts to process in a new step. (#78) ### Security