You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mappings defined in other YAML files cannot be merged using the YAML merge key. When attempting this, the following error occurs.
$ scuba fooscuba: Config error: Error loading .scuba.yml: while constructing a mapping in ".scuba.yml", line 8, column 13expected a mapping for merging, but found scalar in ".scuba.yml", line 3, column 22
Looked into it a bit more. It appears the node type handed to your from_yaml constructor is already a ScalarNode, when I think it should be a MappingNode. Without understanding how PyYAML really intended on doing this, it probably involves using the Resolver, which is how they tag the << merge key node with 'tag:yaml.org,2002:merge' to begin with.
A similar issue was reported in pyyaml upstream: yaml/pyyaml#120
In reviewing the code, it seems like a merge key mapping does not construct custom tags. If it did call the !from_yaml constructor, then it would have received a mapping value (at least in your example, but not in every example).
I think this would have to be fixed in pyyaml by adding support and examples to the above issue.
Mappings defined in other YAML files cannot be merged using the YAML merge key. When attempting this, the following error occurs.
Background
YAML mappings can be merged with with merge key
<<
(https://yaml.org/type/merge.html)Example
The example in this issue uses the following files:
foo.yml
,bar.yml
, and.scuba.yml
PyYAML Output
Expected Behavior
The
environment
key contains the mergedvariables
andsubvars
mappings frombar.yml
:General Notes
Didn't look into this too hard, butconfig.py
definesfrom_yaml
and usesconstruct_scalar
, which is probably related.The text was updated successfully, but these errors were encountered: