Upgrade from 2.3 to 2.4
OmegaConf 2.4 is a prerelease. It is the first feature release since 2.3 and adds richer structured config types, tuple configs, and improvements to interpolation, resolvers, merging, and validation. Read the full 2.4.0rc1 release notes for the complete change list.
Compatibility checklist
- Python: 2.4 requires Python 3.10 or newer. Check the interpreter used by both your application and CI.
- Tuples: native tuples now create immutable
TupleConfigvalues rather than mutableListConfigvalues. Review mutation and sequence-type checks in the tuple migration guide. - Implicit conversion: assignment and typed-container mutation still
convert compatible values, but emit
FutureWarning. Assign the declared type directly or useOmegaConf.update()for explicit conversion. - Missing text:
???remains the missing marker. To store literal???, write\???. A resolver returning plain???now produces a missing value. See missing values. - Resolver registration:
OmegaConf.register_resolver()is the canonical API. The olderregister_new_resolver()andlegacy_register_resolver()methods are deprecated. OmegaConf.create(None): 2.3 returned aDictConfigwrappingNone; 2.4 returns literalNone. Handle or checkNonedirectly instead of relying on config-container behavior.- Resolving missing interpolations: In 2.4,
OmegaConf.resolve()raisesInterpolationToMissingValueErrorwhen an interpolation targets???. Populate the missing value before resolving, or leave the interpolation lazy until it can be satisfied.
New capabilities to consider
Structured configs accept Literal[...], unions of typed containers, unions
of structured config types, and tuple annotations. OmegaConf.typed_list()
and OmegaConf.typed_dict() let you select an otherwise ambiguous union
branch explicitly. oc.coerce converts a resolver value to a requested
primitive node type. OmegaConf.can_select() checks whether a key path can
produce a value, and OmegaConf.structural_equality() compares unresolved
config structure.
Review the compatibility checklist for affected callers, then adopt new features where they simplify a real use case.