Describe the bug
DictConfig keys do not support the same type coercion as other typed fields. For example, floats and strings are not coerced to ints for DictConfig keys, while other fields have no issue.
For some reason, enum coercion seems to be the only thing that works correctly for DictConfig keys.
Additionally, ListConfig type and DictConfig value type coercion seems to work just fine.
Expected behavior
I would expect the above code to print
{'a': 3.0, 'b': {<Color.red: 'RED'>: <Color.blue: 'BLUE'>}, 'c': {3.0: <Color.blue: 'BLUE'>}, 'd': {<Color.red: 'RED'>: 4.0}, 'e': [3.0, 4.0]}
And I do get this output if I change "c":{3: "blue"} to "c":{3.0: "blue"}
Instead I get:
omegaconf.errors.KeyValidationError: Key 3 (int) is incompatible with (float)
full_key: c.3
reference_type=Dict[float, Color]
object_type=dict
I would expect DictConfig keys to be coerced in the same way as DictConfig values, or other fields in general.
Describe the bug DictConfig keys do not support the same type coercion as other typed fields. For example, floats and strings are not coerced to ints for DictConfig keys, while other fields have no issue. For some reason, enum coercion seems to be the only thing that works correctly for DictConfig keys. Additionally, ListConfig type and DictConfig value type coercion seems to work just fine.
To Reproduce
Expected behavior I would expect the above code to print
{'a': 3.0, 'b': {<Color.red: 'RED'>: <Color.blue: 'BLUE'>}, 'c': {3.0: <Color.blue: 'BLUE'>}, 'd': {<Color.red: 'RED'>: 4.0}, 'e': [3.0, 4.0]}
And I do get this output if I change"c":{3: "blue"}
to"c":{3.0: "blue"}
Instead I get:
I would expect DictConfig keys to be coerced in the same way as DictConfig values, or other fields in general.
Additional context