66import great_expectations as gx
77import great_expectations .expectations as gxe
88
9+
910class ExpectLLPGColumnValuesToBeUnique (gxe .ExpectColumnValuesToBeUnique ):
1011 column : str = 'llpg'
1112 description : str = "Expect UPRN (LLPG) values to be unique"
@@ -46,6 +47,14 @@ class ExpectEstateRefNoColumnValuesToMatchRegex(gxe.ExpectColumnValuesToMatchReg
4647 description : str = "Expect Estate Reference Number to match regex ^[0-9]\d+$ (numerical)"
4748
4849
50+ class ExpectTenureValuesToBeInSet (gxe .ExpectColumnValuesToBeInSet ):
51+ column : str = 'tenure'
52+ value_set : list = ['Asylum Seeker' , 'Freehold' , 'Freehold (Serv)' , 'Introductory' ,
53+ 'Leasehold (RTB)' , 'Lse 100% Stair' , 'Mesne Profit Ac' , 'Non-Secure' ,
54+ 'Private Sale LH' , 'Secure' , 'Shared Owners' , 'Short Life Lse' , 'Temp Decant' ,
55+ 'Shared Equity' ]
56+ description : str = "Expect tenure values to contain one of the set"
57+
4958
5059arg_key = ['s3_target_location' ]
5160args = getResolvedOptions (sys .argv , arg_key )
@@ -63,5 +72,6 @@ class ExpectEstateRefNoColumnValuesToMatchRegex(gxe.ExpectColumnValuesToMatchReg
6372suite .add_expectation (ExpectBlockRefNoColumnValuesToMatchRegex ())
6473suite .add_expectation (ExpectLLPGColumnValuesToMatchRegex ())
6574suite .add_expectation (ExpectEstateRefNoColumnValuesToMatchRegex ())
75+ suite .add_expectation (ExpectTenureValuesToBeInSet ())
6676
6777suite = context .suites .add (suite )
0 commit comments