From ebdc0c314e911b06d56ac79f17c9de6b27429f06 Mon Sep 17 00:00:00 2001 From: Eric Charles Date: Wed, 3 Apr 2024 11:10:17 -0700 Subject: [PATCH] fix file closing not to overwrite files when running in chunked mode (#100) --- src/rail/core/stage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rail/core/stage.py b/src/rail/core/stage.py index 7570e6ed..9e288a8a 100644 --- a/src/rail/core/stage.py +++ b/src/rail/core/stage.py @@ -396,7 +396,8 @@ def _finalize_tag(self, tag): """ handle = self.get_handle(tag, allow_missing=True) if self.config.output_mode == 'default': - handle.write() + if not os.path.exists(handle.path) or not handle.partial: + handle.write() final_name = PipelineStage._finalize_tag(self, tag) handle.path = final_name return final_name