[Python] What is the point of using `MISSING` in hydra or pydantic?

Discussão em 'Python' iniciado por Stack, Fevereiro 4, 2025.

  1. Stack

    Stack Membro Participativo

    I am creating a configuration management system in python and are exploring options between hydra/pydantic/both. I get a little confused over when to use MISSING versus just leaving it blank/optional. I will use an example of OmegaConf here since the underlying structure of hydra uses it.

    @dataclass
    class User:
    # A simple user class with two missing fields
    name: str = MISSING
    height: Height = MISSING


    where it says that this MISSING field will convert to yaml's ??? equivalent. Can I just leave it blank?

    Continue reading...

Compartilhe esta Página