Timeliness#

class Timeliness(df, test_params)[source]#

A subclass of Dimension focused on evaluating the timeliness aspect of data quality.

This class assesses the timeliness of data by calculating the difference in time between two date columns in a dataset and comparing this difference to a predefined threshold.

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 column names and threshold values.

Type:

pandas.DataFrame

date_format#

The format in which date strings in the dataset are formatted. This should match the actual format used in the dataset for accurate parsing and comparison.

Type:

str

tests#

A dictionary mapping test names to their relevant information and methods. Currently supports a date difference calculation test.

Type:

dict

date_diff_calc(test)[source]#

Calculates the time difference between two date columns for each row in the dataset, checks if this difference meets a specified threshold, and flags non-compliant rows.

Parameters:

test (dict) – The test configuration, including the comparison column name and date difference threshold.