Repository navigation
Replace strictyaml with PyYAML - #4548
Merged
kevinjqliu merged 3 commits intoDec 1, 2026
Merged
Conversation
strictyaml is no longer maintained. BaseLoader keeps every scalar as a string, which matches how .pyiceberg.yaml is parsed today.
The yaml import needs types-PyYAML in the pre-commit mypy environment.
- Use yaml.CBaseLoader with yaml.BaseLoader fallback when loading .pyiceberg.yaml since Config() is instantiated across runtime paths. - Cover NO, null, ~, empty values, and ISO dates in scalar-preservation config tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
|
thanks for putting this together @Anurag-S1ngh! pushed a small commit on top to:
|
kevinjqliu
approved these changes
Dec 1, 2026
kevinjqliu
left a comment
Contributor
There was a problem hiding this comment.
lgtm! good cleanup to drop an unmaintained dep.
for the record on behavior diffs vs strictyaml:
- all scalars still stay strings (
4,1.0,yes/no/NO,null/~, empty values, dates) and!!python/...tags remain safe (no constructors registered) - duplicate keys now silently take the last value instead of raising, flow style and anchors are accepted (
<<:merge keys stay literal keys), and bad YAML raisesyaml.YAMLErrorinstead ofstrictyamlerrors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4502
Rationale for this change
strictyamlhas not had a release since March 2023 and vendors an outdated copy ofruamel.yaml. PyIceberg only callsstrictyaml.load(yml_str).datawithout a schema, which keeps every scalar as a string.Replace it with
PyYAML'sBaseLoader.BaseLoaderalso keeps every scalar as a string, so.pyiceberg.yamlvalues such as4,yes, and1.0are still returned as strings andConfig.get_int/get_boolkeep their current behavior.uv lockregenerates the lockfile and removesstrictyaml.Are these changes tested?
pytest tests/utils/test_config.py(21 passed)ruff checkandruff format --checkon the changed filesAre there any user-facing changes?
The
strictyamldependency is replaced bypyyaml. Configuration file parsing behavior is unchanged.