Skip to content

Use the validated pydantic model instead of raw dict access #56

Description

@math280h

Config.load_config validates the YAML against RedactDumpConfig and then throws the model away, returning the raw dict (redactdump/core/config.py:117). As a result the codebase is full of stringly-typed access and manual defaulting:

if "limits" not in self.config or "max_rows_per_table" not in self.config["limits"]:

Proposal: return the validated model and pass it around. Defaults move onto the model fields (killing the default-injection block in load_config), typos in config access become type errors, and ty can actually check the call sites.

Internal refactor, no behavior change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions