dwh_auditor.config — Load configuration files and manage DWH settings¶
The dwh_auditor.config module reads config.yaml and manages it type-safely as a Pydantic model. Configuration values obtained from external sources are immediately validated, so invalid values (such as negative unit costs) are detected at startup.
See Configuration File (config.yaml) for detailed configuration value descriptions.
Load and parse configuration file (config.yaml).
- class dwh_auditor.config.PricingConfig(*, tb_scan_usd=6.25)[source]¶
Bases:
BaseModelUnit price setting for cost calculation.
- Parameters:
tb_scan_usd (float)
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class dwh_auditor.config.ThresholdsConfig(*, ignore_full_scan_under_gb=1.0, top_expensive_queries_limit=10, zombie_table_days=90, full_scan_ratio_threshold=0.9)[source]¶
Bases:
BaseModelSetting warning thresholds.
- Parameters:
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class dwh_auditor.config.DbtConfig(*, enabled=False, job_label_key='dbt_model')[source]¶
Bases:
BaseModeldbt linkage settings (for future expansion).
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class dwh_auditor.config.AppConfig(*, pricing=<factory>, thresholds=<factory>, dbt=<factory>)[source]¶
Bases:
BaseModelSchema of the entire configuration file.
- Parameters:
pricing (PricingConfig)
thresholds (ThresholdsConfig)
dbt (DbtConfig)
- pricing: PricingConfig¶
- thresholds: ThresholdsConfig¶
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- dwh_auditor.config.load_config(path)[source]¶
Reads a YAML configuration file, converts it to AppConfig, and returns it.
- Parameters:
path (str) – Configuration file path (e.g. “config.yaml”)
- Returns:
Parsed AppConfig object
- Raises:
FileNotFoundError – If the file does not exist at the specified path
yaml.YAMLError – If YAML parsing fails
pydantic.ValidationError – If the settings do not match the schema
- Return type: