Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralf Grubenmann committed Jun 7, 2023
1 parent 656072b commit baa248d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion renku/command/schema/workflow_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
# limitations under the License.
"""Represent workflow file run templates."""

from itertools import chain
from typing import List, Union

import marshmallow

from renku.command.schema.calamus import fields, prov, renku, schema
Expand All @@ -34,12 +37,15 @@ class Meta:
unknown = marshmallow.EXCLUDE

@marshmallow.pre_dump(pass_many=True)
def fix_ids(self, objs, many, **kwargs):
def fix_ids(self, objs: Union[WorkflowFilePlan, List[WorkflowFilePlan]], many, **kwargs):
"""Renku up to 2.4.1 had a bug that created wrong ids for workflow file entities, this fixes those on export."""

def _replace_id(obj):
obj.unfreeze()
obj.id = obj.id.replace("//plans/", "/")

for child in chain(obj.inputs, obj.outputs, obj.parameters):
child.id = child.id.replace("//plans/", "/")
obj.freeze()

if many:
Expand Down

0 comments on commit baa248d

Please sign in to comment.