Skip to content

Nested dataclasses get top-level "config file" keys #38

@jder

Description

@jder

With this code:

@dataclass
class NestedConfig:
    something: str = field(default="something")

@dataclass
class ComputeConfig:
    nested: NestedConfig = field(default_factory=NestedConfig)

@dataclass
class Config:
    compute: ComputeConfig = field(default_factory=ComputeConfig)

The help includes a top level --nested str key for the config file for nested. I think it should probably be --compute.nested str or similar? I suspect we probably need to change this line to use child.dest rather than child.name?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions