def _has_config_content(cfg: DictConfig) -> bool: if cfg._is_none() or cfg._is_missing(): return False for key in cfg.keys(): if not OmegaConf.is_missing(cfg, key): return True return False
def _has_config_content(cfg: DictConfig) -> bool: if cfg._is_none() or cfg._is_missing(): return False for key in cfg.keys(): if not OmegaConf.is_missing(cfg, key) and key not in ( "defaults", "__HYDRA_REMOVE_TOP_LEVEL_DEFAULTS__", ): return True return False
def test_shallow_copy_missing() -> None: cfg = DictConfig(content=MISSING) c = cfg.copy() c._set_value({"foo": 1}) assert c.foo == 1 assert cfg._is_missing()