Skip to content

Commit

Permalink
fix(task): crash in key check when metadata already copied into the c…
Browse files Browse the repository at this point in the history
…ontainer

This caused the pipeline to crash when the output container already had
the version or config tags present. This happens when `attrs_from` is
used to transfer over metadata.
  • Loading branch information
jrs65 committed Mar 2, 2020
1 parent d4329f6 commit 69b9a51
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions draco/core/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,9 @@ def _save_output(self, output):
# add metadata to output
metadata = {"versions": self.versions, "config": self.pipeline_config}
for key, value in metadata.items():
if key in output.attrs:
raise RuntimeError(
"Can't write {} to output: it already exists.".format(key)
)
# NOTE: this will overwrite any existing metadata keys. This is probably the right
# thing to do for now, but really we should be using the `history` functionality for
# this.
output.attrs[key] = value

# Create a tag for the output file name
Expand Down

0 comments on commit 69b9a51

Please sign in to comment.