Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward flags when loading to creation #1051

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions omegaconf/omegaconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ def create( # noqa F811
)

@staticmethod
def load(file_: Union[str, pathlib.Path, IO[Any]]) -> Union[DictConfig, ListConfig]:
def load(
file_: Union[str, pathlib.Path, IO[Any]],
flags: Optional[Dict[str, bool]] = None,
) -> Union[DictConfig, ListConfig]:
from ._utils import get_yaml_loader

if isinstance(file_, (str, pathlib.Path)):
Expand All @@ -200,9 +203,9 @@ def load(file_: Union[str, pathlib.Path, IO[Any]]) -> Union[DictConfig, ListConf

ret: Union[DictConfig, ListConfig]
if obj is None:
ret = OmegaConf.create()
ret = OmegaConf.create(flags=flags)
else:
ret = OmegaConf.create(obj)
ret = OmegaConf.create(obj, flags=flags)
return ret

@staticmethod
Expand Down