Skip to content

Commit

Permalink
Check the properties for its existence (#112)
Browse files Browse the repository at this point in the history
Co-authored-by: Annmary justine <[email protected]>
  • Loading branch information
annmary-roy and annmary-roy authored Jun 29, 2023
1 parent 731bfda commit 472a36e
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions cmflib/cmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ def merge_created_execution(
execution_cmd: str,
properties: t.Optional[t.Dict] = None,
custom_properties: t.Optional[t.Dict] = None,
orig_execution_name: str = "",
create_new_execution: bool = True
orig_execution_name:str = "",
create_new_execution:bool = True
) -> mlpb.Execution:
# Initializing the execution related fields
properties = {} if properties is None else properties
Expand Down Expand Up @@ -465,15 +465,21 @@ def merge_created_execution(
create_new_execution=create_new_execution
)

uuids = self.execution.properties["Execution_uuid"].string_value
if uuids:
self.execution.properties["Execution_uuid"].string_value = uuids +\
","+properties["Execution_uuid"]
uuids = ""

if "Execution_uuid" in self.execution.properties:
uuids = self.execution.properties["Execution_uuid"].string_value
if uuids:
self.execution.properties["Execution_uuid"].string_value = uuids +\
","+properties["Execution_uuid"]
else:
self.execution.properties["Execution_uuid"].string_value =\
properties["Execution_uuid"]
else:
self.execution.properties["Execution_uuid"].string_value =\
properties["Execution_uuid"]
self.store.put_executions([self.execution])
self.execution.properties["Execution_uuid"].string_value = str(uuid.uuid1())


self.store.put_executions([self.execution])
self.execution_name = str(self.execution.id) + "," + execution_type
self.execution_command = execution_cmd
for k, v in custom_props.items():
Expand Down

0 comments on commit 472a36e

Please sign in to comment.