# pysparky_data_quality.rules

*module*

Factories for reusable, lazy PySpark row-rule expressions.

[View source](https://github.com/PySparky/pysparky-data-quality/blob/46facb9e156e26dfd76fa534c81f75749c7879d8/src/pysparky_data_quality/rules.py#L1-L1)

## pysparky_data_quality.rules.between

*function*

```python
def between(column: str | Column, lower: Any, upper: Any, *, name: str | None = None, null_policy: NullPolicy = 'fail') -> ValidationRule
```

Create an inclusive lower/upper-bound rule for a PySpark column.

NULL input produces a SQL NULL condition. The default policy treats that
result as a failure; ``null_policy="pass"`` explicitly allows it.

[View source](https://github.com/PySparky/pysparky-data-quality/blob/46facb9e156e26dfd76fa534c81f75749c7879d8/src/pysparky_data_quality/rules.py#L48-L69)

## pysparky_data_quality.rules.not_null

*function*

```python
def not_null(column: str | Column, *, name: str | None = None) -> ValidationRule
```

Create a rule that fails when the named column is SQL NULL.

String column references receive a stable default rule name. A Column
expression requires an explicit name because its source column cannot be
inferred through a public PySpark API.

[View source](https://github.com/PySparky/pysparky-data-quality/blob/46facb9e156e26dfd76fa534c81f75749c7879d8/src/pysparky_data_quality/rules.py#L34-L45)
