1+ # flake8: noqa: F821
2+
3+ import sys
4+
5+ from awsglue .utils import getResolvedOptions
6+ import great_expectations as gx
7+ import great_expectations .expectations as gxe
8+
9+
10+ class ExpectPayRefColumnValuesToNotBeNull (gxe .ExpectColumnValuesToNotBeNull ):
11+ column : str = "LACA_PAY_REF"
12+ description : str = (
13+ "Expect LACA_PAY_REF (pay ref) values to not be Null in contacts load"
14+ )
15+
16+
17+ class ExpectValueColumnValuesToNotBeNull (gxe .ExpectColumnValuesToNotBeNull ):
18+ column : str = "LACA_CREATED_DATE"
19+ description : str = "Expect LCDE_CONTACT_VALUE (contact value) to not be Null"
20+
21+
22+ class ExpectArrearCodeToBeInSet (gxe .ExpectColumnValuesToBeInSet ):
23+ column : str = "LACA_ARA_CODE"
24+ value_set : list = [
25+ "BAGF" ,
26+ "BAG1" ,
27+ "RTRN" ,
28+ "FRA2" ,
29+ "ADVR" ,
30+ "RDCN" ,
31+ "DWPR" ,
32+ "DWPN" ,
33+ "EDCL" ,
34+ "NOTE" ,
35+ "RHCN" ,
36+ "CORT" ,
37+ "IUPO" ,
38+ "IRA1" ,
39+ "NTQ" ,
40+ "CON3" ,
41+ "RREQ" ,
42+ "RRFN" ,
43+ "STAT" ,
44+ "SHB" ,
45+ "SNW" ,
46+ "ARRN" ,
47+ "POP" ,
48+ "FRA1" ,
49+ "BCOL" ,
50+ "DWPC" ,
51+ "DWPT" ,
52+ "COUT" ,
53+ "NFA" ,
54+ "NRA2" ,
55+ "FRET" ,
56+ "SCH" ,
57+ "SNP" ,
58+ "VISN" ,
59+ "WOA" ,
60+ "WOC" ,
61+ "WOH" ,
62+ "WON" ,
63+ "CDAT" ,
64+ "CNOK" ,
65+ "ADVC" ,
66+ "EVIC" ,
67+ "FINC" ,
68+ "HBN" ,
69+ "SRA1" ,
70+ "TRA1" ,
71+ "NRA1" ,
72+ "IRA1" ,
73+ "MRA1" ,
74+ "TELO" ,
75+ "RPAN" ,
76+ "RRHB" ,
77+ "RRF" ,
78+ "SAR" ,
79+ "SBA" ,
80+ "SCM" ,
81+ "SSA" ,
82+ "VISI" ,
83+ "WOF" ,
84+ "RCHN" ,
85+ "RDDN" ,
86+ "CDL" ,
87+ "FINI" ,
88+ "GRA1" ,
89+ "AGRL" ,
90+ "SRA2" ,
91+ "TRA2" ,
92+ "NRA2" ,
93+ "IRA2" ,
94+ "MRA2" ,
95+ "CWAL" ,
96+ "TELI" ,
97+ "RELI" ,
98+ "LREF" ,
99+ "NOSP" ,
100+ "INTV" ,
101+ "SUP" ,
102+ "UCC"
103+ ]
104+ description : str = "Expect arrear code to be one of the set"
105+
106+
107+ class ExpectArrearsActionsColumnsToMatchOrderedList (gxe .ExpectTableColumnsToMatchOrderedList ):
108+ column_list = [
109+ "LACA_BALANCE" ,
110+ "LACA_PAY_REF" ,
111+ "LACA_TYPE" ,
112+ "LACA_CREATED_BY" ,
113+ "LACA_CREATED_DATE" ,
114+ "LACA_ARREARS_DISPUTE_IND" ,
115+ "LACA_ARA_CODE" ,
116+ "LACA_STATUS" ,
117+ "LACA_HRV_ADL_CODE" ,
118+ "LACA_EAC_EPO_CODE" ,
119+ "LACA_EFFECTIVE_DATE" ,
120+ "LACA_EXPIRY_DATE" ,
121+ "LACA_NEXT_ACTION_DATE" ,
122+ "LACA_AUTH_DATE" ,
123+ "LACA_AUTH_USERNAME" ,
124+ "LACA_PRINT_DATE" ,
125+ "LACA_DEL_"
126+ ]
127+ description : str = "Expect columns to match ordered list exactly"
128+
129+
130+ arg_key = ["s3_target_location" ]
131+ args = getResolvedOptions (sys .argv , arg_key )
132+ locals ().update (args )
133+
134+ # add to GX context
135+ context = gx .get_context (mode = "file" , project_root_dir = s3_target_location )
136+
137+ suite = gx .ExpectationSuite (name = "arrears_actions_data_load_suite" )
138+
139+ suite .add_expectation (ExpectArrearsActionsColumnsToMatchOrderedList ())
140+ suite .add_expectation (ExpectArrearCodeToBeInSet ())
141+ suite .add_expectation (ExpectPayRefColumnValuesToNotBeNull ())
142+ suite .add_expectation (ExpectValueColumnValuesToNotBeNull ())
143+ suite = context .suites .add (suite )
0 commit comments