Open pta200 opened 4 months ago
Thanks for the report!
From the stack trace (node = self.yaml_representers[None](self, data)
), it looks like we're leaving some None
values in the object and the yaml encoder doesn't like that.
It may be related to this code. We already delete None
valued keys, but don't do so if the value is an array element. So, I'd wager that we have an array containing None
values in the data model, for some reason.
Assignee will want to dig into what exactly the resulting model is and figure out where the None
values are to narrow in on a fix.
Expected Behaviour
Following the example from the readme I would expect to be able to do generate YAML as easily as JSON.
obj = model_to_object(model=job_template)
print(yaml.safe_dump(obj))
Current Behaviour
Current behavior is that pyyaml throws the following exception processing the job name.
Reproduction Steps
Run the included code snipet
Code Snippet