Q. How to remove keys on merge?
- Dominant language
- Python
- Stars
- 135
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
### Expected Behaviour
If I am setting a key/object in my top level `globals.yaml` at a specific lower level, I want to be able to remove that key (e.g. not just set the `value: null` but actually `del`). For example:
`global.yaml`
```
modules_to_deploy:
module1:
module2:
module3:
```
then in my `special_dr_site.yaml`:
```
modules_to_deploy:
module2: #remove
```
After merging, for my `special_dr_site`, I want the resulting yaml to be:
```
modules_to_deploy:
module1:
module3:
```
### Actual Behaviour
Not sure if/how this can be achieved?
### Reproduce Scenario (including but not limited to)
simply try the simple example above.
#### Steps to Reproduce
see above example
#### Platform and Version
Any
Contributor guide
Research direction
Start by reproducing the merge of global.yaml and special_dr_site.yaml from the issue, then locate the package entry point that performs hierarchical YAML merging. Read the existing merge behavior and tests, if present, to determine how deletion markers are handled; done means module2 is absent from the merged result while module1 and module3 remain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, yaml
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100