Future compat omegaconf yaml loader#870
Merged
Merged
Conversation
OmegaConf PR #1296 ("Limit YAML alias expansion") moved get_yaml_loader
out of omegaconf._utils and into omegaconf._yaml, and the new loader
registers the pathlib._local.* constructors itself. Guard the existing
monkey-patch with hasattr so the import doesn't crash against the new
layout; on new omegaconf the upstream loader already does what this
patch was injecting.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Use the existing _compatibility.OMEGACONF_VERSION pattern to express this as a version-based feature gate rather than a runtime attribute probe. The new OMEGACONF_EXPOSES_GET_YAML_LOADER_IN_UTILS flag captures the fact that OmegaConf 2.4.0 (PR #1296) moved get_yaml_loader out of _utils into _yaml and registers the pathlib._local constructors itself. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
OMEGACONF_EXPOSES_GET_YAML_LOADER_IN_UTILS described where the function lived, which is only the symptom that surfaced this incompatibility. The semantic content of the gate is whether OmegaConf's yaml loader itself constructs pathlib._local.* paths, so name it that way: OMEGACONF_HANDLES_PATHLIB_LOCAL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The `if not OMEGACONF_HANDLES_PATHLIB_LOCAL:` branch only exercises one side per environment, so coverage flags the unused edge. Matches the prior-art pattern in third_party/pydantic.py. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Hey! Any idea when this is planned to get released? No time pressure, it's just to know when we can expect to remove the deps pins in pyproject files (some users use the pre-release flag so we have to be defensive) |
Contributor
Author
|
Publishing a release candidate right now |
|
Wow amazing |
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.
No description provided.