Skip to content

Commit

Permalink
Add documentation on lack of validation for container nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
odelalleau committed Mar 9, 2021
1 parent b556a82 commit 1a77110
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/source/structured_config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,18 @@ Interpolated values are validated, and converted when possible, to the annotated
>>> cfg.str_key = "1234" # string value
>>> assert cfg.int_key == 1234 # automatically convert str to int

Note however that this validation step is currently skipped for container node interpolations:

.. doctest::

>>> @dataclass
... class NotValidated:
... some_int: int = 0
... some_dict: Dict[str, str] = II("some_int")

>>> cfg = OmegaConf.structured(NotValidated)
>>> assert cfg.some_dict == 0 # type mismatch, but no error


Frozen
^^^^^^
Expand Down

0 comments on commit 1a77110

Please sign in to comment.