Skip to content

Commit

Permalink
[OB-625] adding metaflow/cron annotation to argo workflows (#1852)
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsgarg-ob authored May 21, 2024
1 parent 9093153 commit 0654b85
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions metaflow/plugins/argo/argo_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,14 @@ def _compile_workflow_template(self):
),
}

if self._schedule is not None:
# timezone is an optional field and json dumps on None will result in null
# hence configuring it to an empty string
if self._timezone is None:
self._timezone = ""
cron_info = {"schedule": self._schedule, "tz": self._timezone}
annotations.update({"metaflow/cron": json.dumps(cron_info)})

if self.parameters:
annotations.update({"metaflow/parameters": json.dumps(self.parameters)})

Expand Down

0 comments on commit 0654b85

Please sign in to comment.