Repository navigation
Conversation
_register_new_resolvers skipped every resolver whose name was already registered, so kwargs such as replace=True never reached OmegaConf.register_new_resolver() and the old resolver was kept silently. An already-registered resolver is now skipped only when the resolver kwargs do not contain replace=True; plain callables and tuples without replace keep their previous behaviour. Signed-off-by: Shahzeb Ali <[email protected]>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Thanks @Shahzeb-DataEngineer for this PR! The issue associated with this PR has not been marked for external contribution yet. As a policy, we only accept contributions for issues marked as "Ready" on this board: OS contribution tasks |
|
Thanks @jitu5, understood. No rush at all, happy to wait while the ticket goes through internal discussion. The PR is ready from my side whenever the issue is marked Ready; just let me know if you would like any changes in the meantime. |
Move the RELEASE.md note from Bug fixes into the kedro-org#5813 entry under Major features and improvements, since kedro-org#5813 is unreleased; document the skip-unless-replace rule in the OmegaConfigLoader docstrings and in the templating guide; and clear the test resolvers after each test so the tests stay valid when re-run in the same process. Signed-off-by: Shahzeb Ali <[email protected]>
|
Thanks @merelcht, all three points are addressed in the latest commit:
Tests: the |
Signed-off-by: Merel Theisen <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Merel Theisen <[email protected]>
merelcht
left a comment
There was a problem hiding this comment.
Thanks @Shahzeb-DataEngineer, this looks good to me now! ⭐
Description
Since #5813, a custom resolver can be given as a
(callable, kwargs)tuple so kwargs likeuse_cacheorreplacereachOmegaConf.register_new_resolver(). ButOmegaConfigLoader._register_new_resolversskipped every resolver whose name was already registered (if not OmegaConf.has_resolver(name)), so the kwargs never got passed on andreplace=Truesilently did nothing: replacing a resolver only matters when one with that name already exists, which is exactly the skipped case.This PR changes the guard so an already-registered resolver is skipped only when its kwargs do not contain
replace=True; withreplace=Trueit is registered again with the given kwargs. Plain callables and tuples withoutreplacekeep their previous behaviour (an extra debug log now explains why a resolver was skipped).Also adds a
RELEASE.mdentry and two regression tests intests/config/test_omegaconf_config.py: one assertingreplace=Trueswaps the implementation (new world), one asserting the old implementation is kept withoutreplace(old world).Related Issue
closes #5825