Consistency#

class Consistency(df, test_params)[source]#

A subclass of Dimension focused on evaluating the consistency of data within a dataset.

This class performs consistency tests to ensure that data values across different columns adhere to predefined logical relationships or mappings. It supports one-to-one and one-to-many comparisons, as well as date relationship validations.

df#

The dataset to be evaluated, imported via pandas’ read_csv() function.

Type:

pandas.DataFrame

test_params#

The parameters defining how tests should be conducted, including comparison columns and mappings for consistency checks.

Type:

pandas.DataFrame

date_format#

The format used for parsing dates within the dataset. This should match the actual date format for accurate comparisons.

Type:

str

tests#

A dictionary mapping test names to their relevant information and methods. Supports tests for one-to-one or one-to-many comparisons and date relationships.

Type:

dict

test_one_to_one(test)[source]#

Performs one-to-one or one-to-many comparisons between values in specified columns based on a mapping.

Parameters:

test (str) – The name of the test to be executed.

date_relationships(test)[source]#

Validates date relationships (e.g., greater than, less than) between two date columns.

Parameters:

test (str) – The name of the test to be executed.