Skip to main content
Version: 1.8.0

tabsdata.dataquality

AllOkA boolean criteria that selects records where all boolean classifiers pass (True).
AnyFailedA boolean criteria that selects records where at least one boolean classifier fails (False).
BoolClassifierAbstract base class for classifiers that produce a boolean result (True or False).
BoolClassifier.supported_dtypesReturns the set of data types supported by boolean classifiers.
BoolCriteriaA boolean criteria to select records based on classifier results.
CategorizerA base class for categorizers.
Categorizer.supported_dtypesReturns the set of data types supported by this classifier.
CategoryCriteriaA category criteria to select records based on classifier results.
ClassifierAbstract base class for all data quality classifiers.
Classifier.supported_dtypesReturns the set of data types supported by this classifier.
CriteriaDefines the conditions for selecting records based on classifier results.
DataQualityRepresents a data quality action to be performed on a table.
DoesNotMatchA boolean classifier that checks if a value does not match a regex pattern.
DoesNotMatch.supported_dtypesReturns the set of data types supported by Matches classifier.
EnrichAn operator that adds the data quality classifier columns to the original table frame.
ExponentialScaleAn exponential scale.
FailAn operator that fails the current transaction if a data quality threshold is met.
FilterAn operator that filters rows from a table based on data quality criteria.
HasLengthA boolean classifier that checks if the length of a value is within a given range.
HasLength.supported_dtypesReturns the set of data types supported by HasLength classifier.
IdentityScaleAn identity scale where each integer value corresponds to a bin.
InBinsA category criteria that selects records where the value in the specified columns falls into one of the given bins.
IsBetweenA boolean classifier that checks if a value is inside a specified range.
IsBetween.supported_dtypesReturns the set of data types supported by IsBetween classifier.
IsFalseA boolean classifier that checks if a value is False.
IsFalse.supported_dtypesReturns the set of data types supported by IsFalse classifier.
IsInA boolean classifier that checks if a value is in a specified set of values.
IsIn.supported_dtypesReturns the set of data types supported by IsIn classifier.
IsNanA boolean classifier that checks if a value is NaN (Not a Number).
IsNan.supported_dtypesReturns the set of data types supported by IsNan classifier.
IsNegativeA boolean classifier that checks if a numeric value is negative.
IsNegative.supported_dtypesReturns the set of data types supported by IsNegative classifier.
IsNegativeOrZeroA boolean classifier that checks if a numeric value is negative or zero.
IsNegativeOrZero.supported_dtypesReturns the set of data types supported by IsNegativeOrZero classifier.
IsNotBetweenA boolean classifier that checks if a value is outside a specified range.
IsNotBetween.supported_dtypesReturns the set of data types supported by IsBetween classifier.
IsNotInA boolean classifier that checks if a value is not in a specified set of values.
IsNotIn.supported_dtypesReturns the set of data types supported by IsIn classifier.
IsNotNanA boolean classifier that checks if a value is not NaN.
IsNotNan.supported_dtypesReturns the set of data types supported by IsNotNan classifier.
IsNotNullA boolean classifier that checks if a value is not NULL.
IsNotNull.supported_dtypesReturns the set of data types supported by IsNotNull classifier.
IsNotNullNorNanA boolean classifier that checks if a value is neither NULL nor NaN.
IsNotNullNorNan.supported_dtypesReturns the set of data types supported by IsNotNullNorNan classifier.
IsNotZeroA boolean classifier that checks if a numeric value is not zero.
IsNotZero.supported_dtypesReturns the set of data types supported by IsNotZero classifier.
IsNullA boolean classifier that checks if a value is NULL.
IsNull.supported_dtypesReturns the set of data types supported by IsNull classifier.
IsNullOrNanA boolean classifier that checks if a value is either NULL or NaN.
IsNullOrNan.supported_dtypesReturns the set of data types supported by IsNullOrNan classifier.
IsPositiveA boolean classifier that checks if a numeric value is positive.
IsPositive.supported_dtypesReturns the set of data types supported by IsPositive classifier.
IsPositiveOrZeroA boolean classifier that checks if a numeric value is positive or zero.
IsPositiveOrZero.supported_dtypesReturns the set of data types supported by IsPositiveOrZero classifier.
IsTrueA boolean classifier that checks if a value is True.
IsTrue.supported_dtypesReturns the set of data types supported by IsTrue classifier.
IsZeroA boolean classifier that checks if a numeric value is zero.
IsZero.supported_dtypesReturns the set of data types supported by IsZero classifier.
LinearScaleA linear scale.
LogarithmicScaleA logarithmic scale.
MatchesA boolean classifier that checks if a value matches a regex pattern.
Matches.supported_dtypesReturns the set of data types supported by Matches classifier.
MonomialScaleA monomial (power-law) scale.
NotInBinsA category criteria that selects records where the value in the specified columns does not fall into any of the given bins.
OperatorAbstract base class for all data quality operators.
PercentThresholdA threshold based on a percentage of total rows.
RowCountThresholdA threshold based on a specific number of rows.
ScaleAbstract base class for scales used in categorization.
ScaleCategorizerA classifier that bucketizes data into bins based on a given scale.
ScaleCategorizer.supported_dtypesReturns the set of data types supported by categorizers.
SelectAn operator that selects rows based on data quality criteria and writes them to another table.
SummaryAn operator that generates a data quality summary report for a table.
ThresholdAbstract base class for thresholds used in the Fail operator.

BoolClassifier

class BoolClassifier(
column_names: str | tuple[str, str | None] | Annotated[list[str], <class 'Strict'>] | Annotated[list[tuple[str, str | None]], <class 'Strict'>] | NoneType = None,
on_missing_column: Literal['ignore', 'fail'] = 'ignore',
on_wrong_type: Literal['ignore', 'fail'] = 'ignore',
on_wrong_value: Literal['ignore', 'fail'] = 'ignore',
tags: str | list[str] | NoneType = None,
)

Bases: Classifier, ABC

Abstract base class for classifiers that produce a boolean result (True or False).

property
column_nameslist[tuple[str, str | None]] | None

Returns the list of columns the classifier applies to, including optional destination column names.

property
on_missing_columnLiteral['ignore', 'fail']

Returns what do if the column is missing.

property
on_wrong_typeLiteral['ignore', 'fail']

Returns what do if the column type is incompatible with the classifier.

property
on_wrong_valueLiteral['ignore', 'fail']

Returns what do if the column type is incompatible with the classifier.

property
tagslist[str] | None

Returns the list of tags associated with the classifier.

supported_dtypes
def supported_dtypes() -> FrozenSet[Type]

Returns the set of data types supported by boolean classifiers.


BoolCriteria

class BoolCriteria(
none_is_ok: bool,
nan_is_ok: bool,
tags: str | list[str] | NoneType = None,
)

Bases: Criteria, ABC

A boolean criteria to select records based on classifier results.

Initializes the BoolCriteria operator.

Parameters:

parameter
none_is_ok

If None values should be considered OK.

parameter
nan_is_ok

If NaN values should be considered OK.

parameter
tags

Optional tags to link this operator to specific classifiers.

property
nan_is_okbool

Returns if NaN values should be considered OK.

property
none_is_okbool

Returns if None values should be considered OK.

property
tagslist[str] | None

Returns the list of tags associated with this criteria.


Categorizer

class Categorizer(
column_names: str | tuple[str, str | None] | Annotated[list[str], <class 'Strict'>] | Annotated[list[tuple[str, str | None]], <class 'Strict'>] | NoneType = None,
on_missing_column: Literal['ignore', 'fail'] = 'ignore',
on_wrong_type: Literal['ignore', 'fail'] = 'ignore',
on_wrong_value: Literal['ignore', 'fail'] = 'ignore',
tags: str | list[str] | NoneType = None,
)

Bases: Classifier, ABC

A base class for categorizers.

property
column_nameslist[tuple[str, str | None]] | None

Returns the list of columns the classifier applies to, including optional destination column names.

property
on_missing_columnLiteral['ignore', 'fail']

Returns what do if the column is missing.

property
on_wrong_typeLiteral['ignore', 'fail']

Returns what do if the column type is incompatible with the classifier.

property
on_wrong_valueLiteral['ignore', 'fail']

Returns what do if the column type is incompatible with the classifier.

property
tagslist[str] | None

Returns the list of tags associated with the classifier.

supported_dtypes
def supported_dtypes() -> FrozenSet[Type]

Returns the set of data types supported by this classifier.


CategoryCriteria

class CategoryCriteria(
column_name: str,
bins: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=100)])] | Literal['none', 'nan', 'underflow', 'overflow'] | Annotated[list[Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=100)])] | Literal['none', 'nan', 'underflow', 'overflow']], <class 'Strict'>],
)

Bases: Criteria, ABC

A category criteria to select records based on classifier results.

Initializes the CategoryCriteria operator.

Parameters:

parameter
column_name

The column name to check for values.

parameter
bins

A single bin or a list of bins.

property
binsAbstractSet[Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=100)])] | Literal['none', 'nan', 'underflow', 'overflow']]

Returns a set of bins.

property
column_namestr

Returns the column name to check for values.


Classifier

class Classifier(
column_names: str | tuple[str, str | None] | Annotated[list[str], <class 'Strict'>] | Annotated[list[tuple[str, str | None]], <class 'Strict'>] | NoneType = None,
on_missing_column: Literal['ignore', 'fail'] = 'ignore',
on_wrong_type: Literal['ignore', 'fail'] = 'ignore',
on_wrong_value: Literal['ignore', 'fail'] = 'ignore',
tags: str | list[str] | NoneType = None,
)

Bases: ABC

Abstract base class for all data quality classifiers.

A classifier is applied to one or more columns to produce a classification result, which is stored in a new column. It supports tags to allow data quality operations to selectively act on specific classifiers.

Initializes the classifier.

Parameters:

parameter
column_names

The column(s) to apply the classifier to. - A string or list of strings specifies the source columns. The results are stored in columns with auto-generated names. - A tuple (source, destination) or a list of such tuples allows specifying custom names for the result columns. - If None, the classifier is applied to all columns.

parameter
on_missing_column

What to do if a column name is missing.

parameter
on_wrong_type

Behavior when a column’s type is incompatible with the classifier.

parameter
on_wrong_value

Behavior when a classifier's value is incompatible with the column type.

parameter
tags

A tag or list of tags to associate with the classifier. Tags help filter which classifiers an operation should consider.

property
column_nameslist[tuple[str, str | None]] | None

Returns the list of columns the classifier applies to, including optional destination column names.

property
on_missing_columnLiteral['ignore', 'fail']

Returns what do if the column is missing.

property
on_wrong_typeLiteral['ignore', 'fail']

Returns what do if the column type is incompatible with the classifier.

property
on_wrong_valueLiteral['ignore', 'fail']

Returns what do if the column type is incompatible with the classifier.

property
tagslist[str] | None

Returns the list of tags associated with the classifier.

supported_dtypes
def supported_dtypes() -> FrozenSet[Type]

Returns the set of data types supported by this classifier.


Criteria

class Criteria(*args, **kwargs)

Bases: ABC

Defines the conditions for selecting records based on classifier results.

A Criteria object specifies which rows of a table should be considered for a data quality operation. This can be based on the outcomes of boolean classifiers or the binning results of categorical classifiers.


Operator

class Operator(*args, **kwargs)

Bases: ABC

Abstract base class for all data quality operators.

This class provides a common structure for operators, including support for tags, which allow for selective application of classifiers.


RowCountThreshold

class RowCountThreshold(
row_count: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0)])],
)

Bases: Threshold

A threshold based on a specific number of rows.

Initializes the threshold with a maximum row count.

Parameters:

parameter
row_count

The number of rows that, if met or exceeded, will trigger the Fail operation.

property
row_countint

Returns the row count for the threshold.


Scale

class Scale(
scale_range: tuple[Annotated[int, Strict(strict=True)] | Annotated[float, Strict(strict=True)], Annotated[int, Strict(strict=True)] | Annotated[float, Strict(strict=True)]],
bins: Annotated[int, Strict(strict=True), FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=1), Le(le=100)])],
use_bin_zero: bool,
)

Bases: ABC

Abstract base class for scales used in categorization.

A scale defines how numerical data is divided into bins.

property
use_bin_zerobool

Returns whether the minimum value is in bin zero or in bin one.


Threshold

class Threshold(*args, **kwargs)

Bases: ABC

Abstract base class for thresholds used in the Fail operator.