Skip to content

Commit

Permalink
check description key exist (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwdchang committed Sep 24, 2024
1 parent 0ef63f5 commit bb580e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/askem_beaker/contexts/dataset/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,13 @@ async def save_dataset_request(self, message):
new_dataset = copy.deepcopy(parent_dataset)
del new_dataset["id"]
new_dataset["name"] = new_name
new_dataset["description"] += f"\\nTransformed from dataset '{parent_dataset['name']}' ({parent_dataset['id']}) at {datetime.datetime.utcnow().strftime('%c %Z')}"

transformed_info = f"Transformed from dataset '{parent_dataset['name']}' ({parent_dataset['id']}) at {datetime.datetime.utcnow().strftime('%c %Z')}"
if "description" in new_dataset:
new_dataset["description"] += f"\\n{transformed_info}"
else:
new_dataset["description"] = transformed_info

new_dataset["fileNames"] = [filename]
#clear the columns field on the new dataset as there was likely a change to either the columns or the data. HMI-Server will deal with regenerating this.
new_dataset["columns"] = []
Expand Down

0 comments on commit bb580e4

Please sign in to comment.