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

Evaluate support for non primitive objects #382

Closed
omry opened this issue Sep 21, 2020 · 1 comment
Closed

Evaluate support for non primitive objects #382

omry opened this issue Sep 21, 2020 · 1 comment
Labels
enhancement New feature or request wishlist
Milestone

Comments

@omry
Copy link
Owner

omry commented Sep 21, 2020

This is opening a very large surface area and it will make supporting some things like serialization impossible in such cases, but it's still a highly requested feature.
A few thoughts:

  1. For regular DictConfig it could be off by default and enable via a config flag.
  2. In Structured Configs, we could support it as a new node type.
@omry omry added enhancement New feature or request wishlist labels Sep 21, 2020
@omry omry added this to the OmegaConf 2.1 milestone Sep 21, 2020
@omry
Copy link
Owner Author

omry commented Sep 22, 2020

As a temporary solution, I added an unofficial API in #384 and #385, this is a new flag with the name "allow_objects".

Usage is something like:

    iv = object()
    with flag_override(c, "allow_objects", True):
        c.a.b = iv
        assert c.a.b == iv

Note that this is not yet an official API.
Trying to serialize a config with arbitrary objects is likely to break break serialization (yaml ot pickly) and possibly cause other issues. If you use it please report any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wishlist
Projects
None yet
Development

No branches or pull requests

1 participant