@@ -20,9 +20,9 @@ def setUpClass(cls):
2020 .getOrCreate ())
2121 cls .sc = cls .spark .sparkContext
2222 cls .df = cls .sc .parallelize ([
23- Row (a = "foo" , b = 1 , c = 5 , d = 5 , e = 3 , f = 1 , g = 'a' , h = 0 , creditCard = "5130566665286573" , email = "foo@example.com" , ssn = "123-45-6789" , URL = "http://userid@example.com:8080" , boolean = "true" ),
24- Row (a = "bar" , b = 2 , c = 6 , d = 5 , e = 2 , f = 2 , g = 'b' , h = - 1 , creditCard = "4532677117740914" , email = "bar@example.com" , ssn = "123456789" , URL = "http://foo.com/(something)?after=parens" , boolean = "false" ),
25- Row (a = "baz" , b = 3 , c = None , d = 5 , e = 1 , f = 1 , g = None , h = 2 , creditCard = "3401453245217421 " , email = "yourusername@meow.com" , ssn = "000-00-0000" , URL = "http://userid@example.com:8080" , boolean = "true" )]).toDF ()
23+ Row (a = "foo" , b = 1 , c = 5 , d = 5 , e = 3 , f = 1 , g = 'a' , h = 0 , creditCard = "5130566665286573" , email = "foo@example.com" , ssn = "123-45-6789" , URL = "http://userid@example.com:8080" , boolean = "true" ),
24+ Row (a = "bar" , b = 2 , c = 6 , d = 5 , e = 2 , f = 2 , g = 'b' , h = - 1 , creditCard = "4532677117740914" , email = "bar@example.com" , ssn = "123456789" , URL = "http://foo.com/(something)?after=parens" , boolean = "false" ),
25+ Row (a = "baz" , b = 3 , c = None , d = 5 , e = 1 , f = 1 , g = None , h = 2 , creditCard = "340145324521741 " , email = "yourusername@meow.com" , ssn = "000-00-0000" , URL = "http://userid@example.com:8080" , boolean = "true" )]).toDF ()
2626
2727 @classmethod
2828 def tearDownClass (cls ):
@@ -804,7 +804,7 @@ def test_fail_hasMinLength(self):
804804 [Row (constraint_status = 'Success' )])
805805
806806 def test_hasMaxLength (self ):
807- self .assertEqual (self .hasMaxLength ("email" , lambda x : x == 24 , "Column email has 24 characters max" ),
807+ self .assertEqual (self .hasMaxLength ("email" , lambda x : x == 21 , "Column email has 24 characters max" ),
808808 [Row (constraint_status = 'Success' )])
809809 self .assertEqual (self .hasMaxLength ('email' , lambda x : x == 25 , "does not meet criteria" ),
810810 [Row (constraint_status = 'Failure' )])
0 commit comments