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

OmegaConf.to_yaml does not convert Enum DictConfig keys to string #531

Closed
Jasha10 opened this issue Feb 10, 2021 · 0 comments · Fixed by #549
Closed

OmegaConf.to_yaml does not convert Enum DictConfig keys to string #531

Jasha10 opened this issue Feb 10, 2021 · 0 comments · Fixed by #549
Assignees
Labels
bug Something isn't working easy
Milestone

Comments

@Jasha10
Copy link
Collaborator

Jasha10 commented Feb 10, 2021

from enum import Enum
from omegaconf import OmegaConf

class Color(Enum):
    RED = 1
    BLUE = 2

conf = OmegaConf.create({Color.RED: Color.BLUE})

print(OmegaConf.to_yaml(conf))

Outputs:

? !!python/object/apply:__main__.Color
- 1
: BLUE

Expected output:

RED: BLUE

Note that the DictConfig value Color.BLUE is converted to a string, but the key Color.RED is not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working easy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants