Skip to content

Commit

Permalink
Set cascade_backrefs=False on WorkflowInvocationStep.output_dataset_c…
Browse files Browse the repository at this point in the history
…ollections, add safeguard
  • Loading branch information
jdavcs committed Dec 4, 2023
1 parent 657ae17 commit 855a0c1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8873,7 +8873,9 @@ class WorkflowInvocationStep(Base, Dictifiable, Serializable):
job = relationship("Job", back_populates="workflow_invocation_step", uselist=False)
implicit_collection_jobs = relationship("ImplicitCollectionJobs", uselist=False)
output_dataset_collections = relationship(
"WorkflowInvocationStepOutputDatasetCollectionAssociation", back_populates="workflow_invocation_step"
"WorkflowInvocationStepOutputDatasetCollectionAssociation",
back_populates="workflow_invocation_step",
cascade_backrefs=False,
)
output_datasets = relationship(
"WorkflowInvocationStepOutputDatasetAssociation",
Expand Down Expand Up @@ -8942,6 +8944,9 @@ def add_output(self, output_name, output_object):
elif output_object.history_content_type == "dataset_collection":
output_assoc = WorkflowInvocationStepOutputDatasetCollectionAssociation()
output_assoc.workflow_invocation_step = self
# Safeguard: output_assoc was implicitly merged into this Session prior to SQLAlchemy 2.0.
if object_session(self):
object_session(self).add(output_assoc)
output_assoc.dataset_collection = output_object
output_assoc.output_name = output_name
self.output_dataset_collections.append(output_assoc)
Expand Down

0 comments on commit 855a0c1

Please sign in to comment.