validate_dataset_local()

Validate that a DataFrame is SDMX compliant and return a DataFrame of errors.

Usage

Source

validate_dataset_local(
    df, schema=None, valid=None, sdmx_cols=None, max_errors=1000
)

Pass schema so validation info (including the expected SDMX reference columns) can be inferred. The valid parameter is retained as a deprecated shim for callers that previously cached the output of ~tidysdmx.utils.extract_validation_info().

Parameters

df: pd.DataFrame

The DataFrame to be validated.

schema: Schema | None = None

The schema object (optional if valid is provided).

valid: dict[str, object] | None = None

Deprecated. Precomputed validation information returned by ~tidysdmx.utils.extract_validation_info(). This argument will be removed in a future release; pass schema directly instead.

sdmx_cols: list[str] | None = None

SDMX reference columns expected in the dataset. When omitted, the columns are inferred from the schema’s context (e.g. ['DATAFLOW', 'DATAFLOW_ID', 'ACTION'] for a dataflow schema, ['STRUCTURE', 'STRUCTURE_ID', 'ACTION'] for a datastructure schema).

max_errors: int = 1000
Maximum number of individual errors to report per validation check. Defaults to 1000.

Returns

pd.DataFrame

A DataFrame containing validation errors. Each row is one error, with

columns Validation and Error.