chartbook.diagnostics#

Utilities for generating metadata diagnostics reports.

Module Contents#

Classes#

Functions#

build_diagnostics

Generate diagnostics rows for all pipelines, dataframes, and charts.

generate_metadata_diagnostics

Create the metadata diagnostics CSV inside the docs build directory.

get_active_policy

Return the manifest’s resolved policy, or the default warn-only policy.

write_diagnostics_csv

Write diagnostics rows to a CSV file.

Data#

API#

chartbook.diagnostics.CHART_FIELDS: list[str]#

[‘name’, ‘description’, ‘dataframe’, ‘tags’, ‘frequency’, ‘observation_period’, ‘release_lag’, ‘rele…

chartbook.diagnostics.DATAFRAME_FIELDS: list[str]#

[‘name’, ‘description’, ‘sources’, ‘providers’, ‘provider_links’, ‘tags’, ‘pull_method’, ‘path’]

chartbook.diagnostics.DEFAULT_REQUIRED_FIELDS: dict[str, list[str]]#

None

chartbook.diagnostics.DOCS_FIELDS: tuple[str, str]#

(‘docs_path’, ‘docs’)

class chartbook.diagnostics.DiagnosticRow[source]#
identifier: str#

None

metadata_complete: bool#

None

missing_fields: str#

None

object_name: str#

None

object_type: str#

None

None

pipeline_id: str#

None

to_dict() dict[str, Any][source]#
chartbook.diagnostics.NOTEBOOK_FIELDS: list[str]#

[]

chartbook.diagnostics.OPTIONAL_CHART_FIELDS: list[str]#

[‘series’]

chartbook.diagnostics.PROJECT_FIELDS: list[str]#

[‘name’, ‘description’, ‘maintainer’, ‘contributors’, ‘build’, ‘os_compatibility’, ‘repo_url’]

chartbook.diagnostics.build_diagnostics(manifest: dict[str, Any]) list[chartbook.diagnostics.DiagnosticRow][source]#

Generate diagnostics rows for all pipelines, dataframes, and charts.

Required fields come from the manifest’s [policy] section when present (catalogs), otherwise from the default lists in this module.

chartbook.diagnostics.generate_metadata_diagnostics(manifest: dict[str, Any], docs_build_dir: pathlib.Path) list[chartbook.diagnostics.DiagnosticRow][source]#

Create the metadata diagnostics CSV inside the docs build directory.

Returns:

The diagnostic rows, so callers can enforce strict policy.

chartbook.diagnostics.get_active_policy(manifest: dict[str, Any]) dict[str, Any][source]#

Return the manifest’s resolved policy, or the default warn-only policy.

Catalog manifests carry a resolved policy key; standalone pipelines fall back to the defaults.

chartbook.diagnostics.write_diagnostics_csv(diagnostics: list[chartbook.diagnostics.DiagnosticRow], output_path: pathlib.Path) None[source]#

Write diagnostics rows to a CSV file.