Skip to content

Commit 3c48cff

Browse files
olevskiPanaetius
andauthored
fix(cli): do not freeze/unfreeze plan view model (#3599)
Co-authored-by: Ralf Grubenmann <[email protected]>
1 parent c6833be commit 3c48cff

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

renku/domain_model/dataset.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ class ImageObject(Slots):
180180

181181
id: str
182182
content_url: str
183-
position: str
183+
position: int
184184

185185
def __init__(self, *, content_url: str, id: str, position: int):
186186
id = get_path(id)
@@ -656,8 +656,9 @@ def update_metadata_from(self, other: "Dataset", exclude=None):
656656
# and not match the SHACL definition for Renku. This cannot be addressed in the dataset
657657
# providers because the dataset providers do not have access to the dataset ID which is needed
658658
# for setting the dataset image ID.
659-
for image_ind in range(len(self.images)):
660-
self.images[image_ind].id = ImageObject.generate_id(self.id, self.images[image_ind].position)
659+
if isinstance(self.images, list):
660+
for image_ind in range(len(self.images)):
661+
self.images[image_ind].id = ImageObject.generate_id(self.id, self.images[image_ind].position)
661662

662663
def update_metadata(self, **kwargs):
663664
"""Updates metadata."""

renku/ui/service/serializers/workflows.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from marshmallow_oneofschema import OneOfSchema
2222

2323
from renku.domain_model.dataset import DatasetCreatorsJson
24+
from renku.infrastructure.persistent import Persistent
2425
from renku.ui.cli.utils.plugins import get_supported_formats
2526
from renku.ui.service.serializers.common import RemoteRepositorySchema
2627
from renku.ui.service.serializers.rpc import JsonRPCResponse
@@ -48,9 +49,13 @@ def fix_ids(self, objs, many, **kwargs):
4849
"""Renku up to 2.4.1 had a bug that created wrong ids for workflow file entities, this fixes those on export."""
4950

5051
def _replace_id(obj):
51-
obj.unfreeze()
52+
if isinstance(obj, Persistent):
53+
obj.unfreeze()
54+
5255
obj.id = obj.id.replace("//plans/", "/")
53-
obj.freeze()
56+
57+
if isinstance(obj, Persistent):
58+
obj.freeze()
5459

5560
if many:
5661
for obj in objs:

0 commit comments

Comments
 (0)