Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Fixed no model id issue. #296

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions dev/tools/copy_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,10 @@ def _process_workflow_nodes(self, nodes: list, workflow_id: str):
node["state"]["datasetId"]
]
elif op == "ModelOperation":
node_obj["state"]["modelId"] = self.id_mapper["models"][
node["state"]["modelId"]
]
if "state" in node and "modelId" in node["state"]:
node_obj["state"]["modelId"] = self.id_mapper["models"][
node["state"]["modelId"]
]
else:
print(f"{op} is not currently supported.")
updated_nodes.append(node_obj)
Expand All @@ -261,7 +262,11 @@ def _process_workflow_models(self, models: list):
Method processes the workflow model objects to extract configurations.
"""
for model in models:
new_model_id = self.id_mapper["models"][model["state"]["modelId"]]
model_state = model["state"] if "state" in model else None
if "modelId" in model_state:
new_model_id = self.id_mapper["models"][model_state["modelId"]]
else:
new_model_id = None

# Currently no projects I have looked at have model inputs. - Todd R. July 27, 2023
if len(model["inputs"]):
Expand Down