# Standard.to_validate()

Compile the standard into a validation plan for a table, without running it.

Usage

[Source](https://github.com/posit-dev/pointblank/blob/main/pointblank/standard.py#L1056-L1139)

``` python
Standard.to_validate(
    data,
    tbl_name=None,
)
```

This method makes the [`Validate`](../reference/Validate.md#pointblank.Validate) object that [`apply()`](../reference/Standard.apply.md#pointblank.Standard.apply) makes for each table: it has the standard's steps, thresholds, and governance metadata (owner, consumers, and version), and a label of the form `"Standard: <name> v<version>"`. A step whose column selector matches none of the table's columns will be not applicable when the validation is interrogated (see the *Steps That Don't Apply* section of [`Standard`](../reference/Standard.md#pointblank.Standard)).

Use it to add checks that only one table needs, or to set [`Actions`](../reference/Actions.md#pointblank.Actions), before calling [`interrogate()`](../reference/Validate.interrogate.md#pointblank.Validate.interrogate). The standard itself isn't changed.

## Parameters

`data: IntoDataFrame`  
The table to validate. Any table type that [Validate](../reference/Validate.md#pointblank.Validate) takes can be used.

`tbl_name: str | None = None`  
The name of the table, for the validation's `tbl_name=`.

## Returns

`Validate`  
A [Validate](../reference/Validate.md#pointblank.Validate) object with the standard's steps, not yet interrogated.

## Raises

`TypeError`  
If a step's arguments don't fit its validation method (e.g., a misspelled argument name), since step arguments are only checked when the standard is compiled.

## Examples

Let's compile a standard for one table and add a check of its own before interrogating.

``` python
import pointblank as pb
import polars as pl

id_standard = pb.Standard(
    name="id-columns",
    steps=[pb.Step("col_vals_not_null", columns=pb.ends_with("_id"))],
)

orders = pl.DataFrame(
    {"order_id": [1, 2, 3], "customer_id": [7, None, 9], "amount": [20.0, 5.5, -1.0]}
)

(
    id_standard.to_validate(orders, tbl_name="orders")
    .col_vals_ge(columns="amount", value=0)
    .interrogate()
)
```

[TABLE]

The selector of the standard's step finds the two ID columns, so the step expands into two steps, and the missing customer ID fails the second. The third step, which only this table has, flags the negative amount.
