-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hera fails when a script receives list of pydantic objects as list of expressions #827
Comments
Yaml template
|
Updated the example above with the docker image published to docker hub. |
@halilbilgin thanks for reporting this! @elliotgunton any immediate thoughts here? |
@elliotgunton ping |
Need to play around with some examples, but initial thought is figuring out that when the user has arguments like arguments={"dataset_configs": [x_dataset, y_dataset]} That get converted to: value: '["{{steps.escape-x.outputs.result}}", "{{steps.escape-y.outputs.result}}"]' What we actually want (I think) is without quotes: value: '[{{steps.escape-x.outputs.result}}, {{steps.escape-y.outputs.result}}]' So probably we want to consider something like whether the parameter is in a list, then do we want it to be "stringified"? |
Pre-bug-report checklist
1. This bug can be reproduced using YAML
2. This bug occurs when...
Bug report
Hera script input serialization fails when a script receives a list of pydantic objects as expressionsWhere
x_dataset_config
,y_dataset_config
andtrain_model
are script callables, train-model step receives the following error while serializing the input:The value of the input parameter
ranking_dataset_configs
train_model
receives is as followsDescribe the bug
Double quotes in the expression values are not escaped in Argo, which causes an issue.
Above,
train_model
script receives a list of configs which is equivalent to["{{steps.x-dataset-config.outputs.result}}", "{{steps.y-dataset-config.outputs.result}}"]
. However, Argo doesn't escape the quotes in the expression values so the evaluated list becomes:["{"filename": "x"}", "{"filename": "y"}"]
so, hera fails to serialize this since this is not a valid json dump.To Reproduce
Full Hera code to reproduce the bug:
Expected behavior
The
train-model-fails-1
step above could have worked without any additional change.My current workaround
Escaping double quotes and serializing
dataset_configs
manually as it is shown in the example above (i.e.train-model-works
step)Environment
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: