Skip to main content

integrations.ccflow.ValidationModel

Run a composed validation as a ccflow model.

Usage

Source

integrations.ccflow.ValidationModel()

ccflow is a framework for configuring and running workflows, in which each unit of work is a model that’s called with a context and returns a result. A ValidationModel is such a model for a Pointblank validation: calling it composes a YAML configuration with hydra_interrogate() and returns the interrogated validation. It can be put in a ccflow model registry and run with the rest of a flow.

Parameters

config

The path to a YAML file to compose. Without a file, the configuration is made up of the config group options selected in overrides=.

overrides

Hydra overrides, such as "pointblank/thresholds=strict" to select a config group option or "thresholds.warning=0.2" to set a value.

config_dir

A directory of config groups to add to the search path.

allow_python
Whether to run the Python code in the configuration: the code of python: blocks (see yaml_interrogate()), and the mappings with a _target_ key, which are made into the Python objects they describe. Only set it for configurations that you trust.

Returns

ValidationModel
A model that returns a ValidationResult when it’s called with a ccflow.NullContext.

Examples

Let’s write a configuration that selects the small_table dataset and the strict thresholds (both come with Pointblank), and make a model for it.

import tempfile
from pathlib import Path

from ccflow import NullContext
from pointblank.integrations.ccflow import ValidationModel

config = Path(tempfile.mkdtemp()) / "small_table.yaml"
config.write_text('''
defaults:
- override /pointblank/tbl: small_table
- override /pointblank/thresholds: strict
- _self_

steps:
- rows_distinct
- col_vals_gt:
    columns: d
    value: 100
''')

model = ValidationModel(config=config)
result = model(NullContext())

result.all_passed
False

The result has the interrogated validation:

result.validation
Pointblank Validation
2026-12-04|20:51:14
PolarsWARNING0.01ERROR0.05CRITICAL0.1
STEP COLUMNS VALUES TBL EVAL UNITS PASS FAIL W E C EXT
#FF3300 1
rows_distinct
rows_distinct()
ALL COLUMNS — ✓ 13 11
0.85
2
0.15
● ● ●
#4CA64C 2
col_vals_gt
col_vals_gt()
d 100 ✓ 13 13
1.00
0
0.00
○ ○ ○ —

The rows_distinct step fails for the duplicate rows of small_table, which is why all_passed is False.