Skip to content

create_quality_config

Public callable

Create the default quality policy used during FabricOps checks.

This helper is typically called in 00_env_config to define baseline severity and failure-routing behavior consumed later by quality notebooks. The returned object only stores policy defaults and performs no IO.

Parameters:

Name Type Description Default
default_severity str

Baseline severity for checks that do not set an explicit level. Supported values are "info", "warning", and "critical".

"warning"
fail_on_critical bool

Whether critical findings should fail readiness/quality outcomes.

True
quarantine_on_failure bool

Whether downstream workflows should quarantine failed data when quarantine handling is available.

False

Returns:

Type Description
QualityConfig

Immutable quality-policy configuration for framework composition.

Raises:

Type Description
ValueError

Raised when default_severity is not one of the supported values.

Notes

This function validates and normalizes config values only. It does not create Fabric resources, move data, or write to storage.

Examples:

>>> quality = create_quality_config(default_severity="critical", fail_on_critical=True)
>>> quality.default_severity
'critical'
Source code in src/fabricops_kit/config.py
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
def create_quality_config(
    default_severity: str = "warning",
    fail_on_critical: bool = True,
    quarantine_on_failure: bool = False,
) -> QualityConfig:
    """Create the default quality policy used during FabricOps checks.

    This helper is typically called in ``00_env_config`` to define baseline
    severity and failure-routing behavior consumed later by quality notebooks.
    The returned object only stores policy defaults and performs no IO.

    Parameters
    ----------
    default_severity : str, default="warning"
        Baseline severity for checks that do not set an explicit level.
        Supported values are ``"info"``, ``"warning"``, and ``"critical"``.
    fail_on_critical : bool, default=True
        Whether critical findings should fail readiness/quality outcomes.
    quarantine_on_failure : bool, default=False
        Whether downstream workflows should quarantine failed data when
        quarantine handling is available.

    Returns
    -------
    QualityConfig
        Immutable quality-policy configuration for framework composition.

    Raises
    ------
    ValueError
        Raised when ``default_severity`` is not one of the supported values.

    Notes
    -----
    This function validates and normalizes config values only. It does not
    create Fabric resources, move data, or write to storage.

    Examples
    --------
    >>> quality = create_quality_config(default_severity="critical", fail_on_critical=True)
    >>> quality.default_severity
    'critical'
    """
    severity = str(default_severity).strip().lower()
    if severity not in {"info", "warning", "critical"}:
        raise ValueError("default_severity must be one of: info, warning, critical.")
    return QualityConfig(
        default_severity=severity,
        fail_on_critical=bool(fail_on_critical),
        quarantine_on_failure=bool(quarantine_on_failure),
    )