Pelage: Defensive analysis for Polars
  • Get started
  • API Reference
  • Examples
  • Coming from dbt
  • Git
  1. API Reference
  • API Reference
  • Check functions
    • has_columns
    • has_dtypes
    • has_no_nulls
    • has_no_infs
    • unique_combination_of_columns
    • accepted_values
    • not_accepted_values
    • accepted_range
    • maintains_relationships
    • column_is_within_n_std
    • custom_check
  • Checks with group_by
    • at_least_one
    • has_mandatory_values
    • has_shape
    • is_monotonic
    • mutually_exclusive_ranges
    • not_constant
    • not_null_proportion
    • unique
  • Exceptions
    • PolarsAssertError

On this page

  • API Reference
    • Check functions
    • Checks with group_by
    • Exceptions

API Reference

Check functions

List of check functions.

has_columns Check if a DataFrame has the specified
has_dtypes Check that the columns have the expected types
has_no_nulls Check if a DataFrame has any null (missing) values.
has_no_infs Check if a DataFrame has any infinite (inf) values.
unique_combination_of_columns Ensure that the selected column have a unique combination per row.
accepted_values Raises error if columns contains values not specified in items
not_accepted_values Raises error if columns contains values specified in List of forbbiden items
accepted_range Check that all the values from specifed columns in the dict items are within the indicated range.
maintains_relationships Function to help ensuring that set of values in selected column remains the same in both DataFrames. This helps to maintain referential integrity.
column_is_within_n_std Function asserting values are within a given STD range, thus ensuring the absence of outliers.
custom_check Use custom Polars expression to check the DataFrame, based on .filter().

Checks with group_by

List of check functions with optional group_by option.

at_least_one Ensure that there is at least one not null value in the designated columns.
has_mandatory_values Ensure that all specified values are present in their respective column.
has_shape Check if a DataFrame has the specified shape.
is_monotonic Verify that values in a column are consecutively increasing or decreasing.
mutually_exclusive_ranges Ensure that the specified columns contains no overlapping intervals.
not_constant Check if a DataFrame has constant columns.
not_null_proportion Checks that the proportion of non-null values in a column is within a a specified range [at_least, at_most] where at_most is an optional argument (default: 1.0).
unique Check if there are no duplicated values in each one of the selected columns.

Exceptions

Types aliases and custom exceptions

PolarsAssertError Custom Error providing detailed information about the failed check.
has_columns