-
Notifications
You must be signed in to change notification settings - Fork 0
/
mytests.py
87 lines (71 loc) · 1.61 KB
/
mytests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
from dataqualitychecks import check_for_nulls
from dataqualitychecks import check_for_min_max
from dataqualitychecks import check_for_valid_values
from dataqualitychecks import check_for_duplicates
test1={
"testname":"Check for nulls",
"test":check_for_nulls,
"column": "monthid",
"table": "DimMonth"
}
test2={
"testname":"Check for min and max",
"test":check_for_min_max,
"column": "month",
"table": "DimMonth",
"minimum":1,
"maximum":12
}
test3={
"testname":"Check for valid values",
"test":check_for_valid_values,
"column": "category",
"table": "DimCustomer",
"valid_values":{'Individual','Company'}
}
test4={
"testname":"Check for duplicates",
"test":check_for_duplicates,
"column": "monthid",
"table": "DimMonth"
}
test5={
"testname":"Check for nulls",
"test":check_for_nulls,
"column": "year",
"table": "DimMonth"
}
test6={
"testname":"Check for min and max",
"test":check_for_min_max,
"column": "quarter",
"table": "DimMonth",
"minimum":1,
"maximum":4
}
test7={
"testname":"Check for valid values",
"test":check_for_valid_values,
"column": "quartername",
"table": "DimMonth",
"valid_values":{'Q1','Q2','Q3','Q4'}
}
test9={
"testname":"Check for nulls",
"test":check_for_nulls,
"column": "billedamount",
"table": "FactBilling"
}
test10={
"testname":"Check for duplicates",
"test":check_for_duplicates,
"column": "billid",
"table": "FactBilling"
}
test11={
"testname":"Check for valid values",
"test":check_for_valid_values,
"column": "quarter",
"table": "DimMonth",
"valid_values":{1,2,3,4}
}