I am trying to run jobs that call python apps that take dictionaries as parameters.
For example, running it locally might look like this:
python3 examples/test.py '{"school":"EFG", "standard": "2", "name": "abc", "city": "miami"}'
So, in my jobspec I am trying to do this:
command: ["/bin/bash","-c"]
args: ["python3 examples/test.py '{"school":"EFG", "standard": "2", "name": "abc", "city": "miami"}'"]
However, I get a yaml error:
error: error parsing job.yaml.tmpl: error converting YAML to JSON: yaml: line 18: could not find expected ':'
I see in yaml lint that it is not valid. The only way I have managed to pass yaml validation is to escape every single quote, which is not scalable for hundreds of jobs that users will be running
args:
- "python3 examples/test.py '{\"school\":\"hello\", \"standard\": \"5\"}'"
Why is this not valid yaml and how can I do this without needing to escape every single quote in a given dictionary a user passes in?