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

On this page

  • PolarsAssertError
    • Examples
    • Attributes
  1. Exceptions
  2. PolarsAssertError

PolarsAssertError

checks.PolarsAssertError(self, df=None, supp_message='')

Custom Error providing detailed information about the failed check.

To investigate the last error in a jupyter notebook you can use:

Examples

>>> from pelage import PolarsAssertError
>>> raise PolarsAssertError
>>> import sys
>>> error = sys.last_value
>>> print(error) # prints the string representation
>>> error.df # access the dataframe object

Attributes

Name Type Description
df pl.DataFrame, optional, by default pl.DataFrame() A subset of the original dataframe passed to the check function with a highlight on the values that caused the check to fail,
supp_message (str, optional) A human readable description of the check failure, and when available a possible way to solve the issue, by default “”
is_monotonic