yacs
yacs copied to clipboard
Duplicate keys in YAML are overwritten with the last key
yacs uses safe_load()
from pyyaml
.
There is a downstream bug with duplicate keys, in the current implementation pyyaml only considers the last key occurrence and does not produce any warning/error: https://github.com/yaml/pyyaml/issues/165 The linked issue contains discussions about workarounds.
This leads to very subtle errors, see e.g. https://github.com/facebookresearch/maskrcnn-benchmark/pull/545
Thanks for flagging this issue. I agree that yacs should check for duplicate keys and raise an exception if any are found.