You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
running Hera code without submitting to Argo (e.g. when exporting to YAML)
running Hera code and submitting to Argo
Bug report
Describe the bug
When submitting a CronWorkflow to Argo, it complains that it is in violation of the Pydantic model. Upon closer inspection, it seems to be complaining specifically about the CronWorkflowStatus attributes (active, conditions, lastTimeScheduled). It was my understanding that these are not attributes that the user is responsible for setting. The CronWorkflow is still submitted and appears to run but the error message below is produced regardless.
Error log if applicable:
115, in create_cron_workflow
w.create()
File "/Users/eskild/miniconda3/envs/nebari/lib/python3.11/site-packages/hera/workflows/cron_workflow.py", line 82, in create
return self.workflows_service.create_cron_workflow(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/eskild/miniconda3/envs/nebari/lib/python3.11/site-packages/hera/workflows/service.py", line 395, in create_cron_workflow
return CronWorkflow(**resp.json())
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "pydantic/main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 3 validation errors for CronWorkflow
status -> active
none is not an allowed value (type=type_error.none.not_allowed)
status -> conditions
none is not an allowed value (type=type_error.none.not_allowed)
status -> lastScheduledTime
none is not an allowed value (type=type_error.none.not_allowed)
…eneration (#637)
<!-- Thank you for submitting a PR to Hera! 🚀 -->
**Pull Request Checklist**
- [x] Fixes#636
- [ ] Tests added
- [x] Documentation/examples added
- [x] [Good commit messages](https://cbea.ms/git-commit/) and/or PR
title
<!-- Also remember to sign off commits or the DCO check will fail on
your PR! -->
**Description of PR**
<!-- If not linked to an issue, please describe your changes here -->
Currently, the Argo server does not return cron workflow statuses when a
users' cron workflow does not execute _immediately_ post submission. So,
`None`s are returned for the independent fields of the cron workflow
status. While the status is indeed optional, the fields are not! This PR
adds a special case for handling this in the service. I am not sure
whether this is a feature or a bug upstream in Argo Workflows.
CC: @iameskild I was able to run your example using the fix in this PR!
<!-- Piece of cake! ✨🍰✨ -->
---------
Signed-off-by: Flaviu Vadan <flaviuvadan@gmail.com>
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
Co-authored-by: Elliot Gunton <egunton@bloomberg.net>
Pre-bug-report checklist
1. This bug can be reproduced using YAML
2. This bug occurs when...
Bug report
Describe the bug
When submitting a CronWorkflow to Argo, it complains that it is in violation of the Pydantic model. Upon closer inspection, it seems to be complaining specifically about the CronWorkflowStatus attributes (active, conditions, lastTimeScheduled). It was my understanding that these are not attributes that the user is responsible for setting. The CronWorkflow is still submitted and appears to run but the error message below is produced regardless.
Error log if applicable:
To Reproduce
Full Hera code to reproduce the bug:
Expected behavior
A clear and concise description of what you expected to happen:
Environment
5.2.0
3.4.4
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: