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

Behavior change: to_container(..., enum_to_str=True) to convert both keys and values #550

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

Comments

@Jasha10
Copy link
Collaborator

Jasha10 commented Feb 17, 2021

$ cat tmp.py
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_container(conf, enum_to_str=True))

$ python tmp.py
{<Color.RED: 1>: 'BLUE'}

Desired output is for both key and value to be converted when enum_to_str is set to True:

{'RED': 'BLUE'}
@Jasha10 Jasha10 changed the title Behavior change: Merging a MISSING node should not change target Behavior change: to_container(..., enum_to_str=True) to convert both keys and values Feb 17, 2021
@Jasha10 Jasha10 self-assigned this Feb 19, 2021
@omry omry closed this as completed in #549 Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant