Skip to content

Commit 6141b8b

Browse files
author
The kauldron Authors
committed
updating Error message propagation in module_configdict. Some exception were not correctly captured
PiperOrigin-RevId: 886772537
1 parent 0b988df commit 6141b8b

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

kauldron/konfig/flags_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def value(self):
121121
_value = self._value # pylint: disable=invalid-name
122122
assert _value is not None, "None for _value is not supported."
123123
if isinstance(_value, module_configdict.ModuleConfigDict):
124-
return _value.module_config
124+
return _value.get_module_config()
125125
else:
126126
# absl.testing.flagsaver.save_flag_values copies the value into ._value
127127
# and then later calls the setter with the original value. This is why

kauldron/konfig/module_configdict.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ def config_args(self) -> Any:
118118
else:
119119
return self.cli_str_arg
120120

121-
@functools.cached_property
122-
def module_config(self) -> konfig.ConfigDict:
121+
def get_module_config(self) -> konfig.ConfigDict:
123122
"""Initialize config from config file.
124123
125124
Returns:
@@ -195,4 +194,4 @@ def get_config_from_module(
195194
) -> konfig.ConfigDict:
196195
"""Get config from module and cli_str_arg."""
197196
modulecfg = ModuleConfigDict(module=module, cli_str_arg=cli_str_arg)
198-
return modulecfg.module_config
197+
return modulecfg.get_module_config()

kauldron/utils/colab.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def iter_sweep_configs(
7979
kontext.set_by_path(module_cfg, k, v)
8080
# Only for visualization.
8181

82-
cfg = module_cfg.module_config
82+
cfg = module_cfg.get_module_config()
8383

8484
sweep_cfg_overwrites = konfig.ConfigDict(sweep_kwargs)
8585
print(f'Work-unit {i+1}:', flush=True)

0 commit comments

Comments
 (0)