Cyril Verluise
11/10/2022, 1:49 PMoptimisation_programme:
type: yaml.YAMLDataSet
filepath: data/test/05_model_input/optimisation_programme.yaml
layer: model_input
However, it fails with the following error:
DataSetError: Failed while saving data to data set YAMLDataSet(filepath=/Users/cyril_verluise/Documents/GitHub/ClimaTeX/dist/apps/alhambra/rendered/alhambra/data/test/05_model_input/optimisation_programme.yaml, protocol=file,
save_args={'default_flow_style': False}).
'str' object has no attribute '__name__'
Expected behaviour
From the doc, I understood that the save function was just a wrapper around yaml.dump which should work with my `optimisation_programme`(dict)
kedro version
0.18.3
Any idea?/Users/cyril_verluise/opt/anaconda3/envs/climatex/lib/python3.8/site-packages/yaml/representer.p │
│ y:331 in represent_object │
│ │
│ 328 │ │ │ listitems = list(listitems) │
│ 329 │ │ if dictitems is not None: │
│ 330 │ │ │ dictitems = dict(dictitems) │
│ ❱ 331 │ │ if function.__name__ == '__newobj__': │
│ 332 │ │ │ function = args[0] │
│ 333 │ │ │ args = args[1:] │
│ 334 │ │ │ tag = 'tag:<http://yaml.org|yaml.org>,2002:python/object/new:' │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: 'str' object has no attribute '__name__'
The above exception was the direct cause of the following exception:
datajoely
11/10/2022, 1:57 PMyaml
libraryCyril Verluise
11/10/2022, 1:58 PMdatajoely
11/10/2022, 1:58 PMCyril Verluise
11/10/2022, 1:59 PMdatajoely
11/10/2022, 2:00 PMCyril Verluise
11/10/2022, 2:04 PMdatajoely
11/10/2022, 2:06 PMCyril Verluise
11/10/2022, 2:08 PMomegaconf.OmegaConf
save and load methods.
Limitation: then the source dict and the reloaded dict are the same iff the source dict did not contain any fancy stuff (which is the reason why we want to use omegaconf)