dbt-labs / dbt-labs/dbt-autofix
Improve YAML parsing
- Dominant language
- Python
- Stars
- 88
- Forks
- 19
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 13
Description
Currently autofix uses a combination of two different YAML parsers, pyyaml and ruamel. ruamel is probably going to be removed from Pypi but we need it currently because pyyaml strips comments. The package upgrade process also has an extremely hacky solution for rewriting YAML files that needs to be replaced.
So we should consolidate the YAML parsing in a single file or potentially a subpackage. One potential approach is to extend pyyaml to retain spans when loading instead of disposing of them when parsing is done. A basic start is here: https://github.com/dbt-labs/dbt-autofix/blob/main/packages/dbt_fusion_package_tools/src/dbt_fusion_package_tools/yaml/loader.py
Contributor guide
Assessment
This issue has not been assessed yet.