Skip to content

Commit 26cb790

Browse files
committed
fix: pass save_as_aritfact for value_from_expression
Signed-off-by: zjgemi <[email protected]>
1 parent 8778552 commit 26cb790

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/dflow/io.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,26 @@ def __setattr__(self, key, value):
531531
self.type = value.type
532532
if value.type is None and self.type is not None:
533533
value.type = self.type
534+
if key == "value_from_expression" and isinstance(value, IfExpression) \
535+
and isinstance(value._then, (InputParameter, OutputParameter)):
536+
if self.save_as_artifact:
537+
value._then.save_as_artifact = True
538+
if value._then.save_as_artifact:
539+
self.save_as_artifact = True
540+
if self.type is None and value._then.type is not None:
541+
self.type = value._then.type
542+
if value._then.type is None and self.type is not None:
543+
value._then.type = self.type
544+
if key == "value_from_expression" and isinstance(value, IfExpression) \
545+
and isinstance(value._else, (InputParameter, OutputParameter)):
546+
if self.save_as_artifact:
547+
value._else.save_as_artifact = True
548+
if value._else.save_as_artifact:
549+
self.save_as_artifact = True
550+
if self.type is None and value._else.type is not None:
551+
self.type = value._else.type
552+
if value._else.type is None and self.type is not None:
553+
value._else.type = self.type
534554
return super().__setattr__(key, value)
535555

536556
def __repr__(self):

0 commit comments

Comments
 (0)