Skip to content

load_data_contract

Public callable

Load and normalize a data product contract from file path or dictionary.

Parameters:

Name Type Description Default
path_or_dict Any

Value used by this callable.

required

Returns:

Type Description
DataProductContract

Structured output produced by this callable.

Source code in src/fabricops_kit/quality.py
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
def load_data_contract(path_or_dict: str | Path | dict) -> DataProductContract:
    """Load and normalize a data product contract from file path or dictionary.

        Parameters
        ----------
        path_or_dict : Any
            Value used by this callable.

        Returns
        -------
        DataProductContract
            Structured output produced by this callable.
    """
    raw = dict(path_or_dict) if isinstance(path_or_dict, dict) else load_dataset_contract(path_or_dict)
    return normalize_data_product_contract(raw)