@@ -523,11 +523,11 @@ def test_inferred_column_structs1(self, setupLogging):
523523 df = df_spec .build ()
524524
525525 type1 = self .getFieldType (df .schema , "struct1" )
526- expectedType = StructType ([StructField ('a' , IntegerType ()), StructField ('b' , IntegerType ())])
526+ expectedType = StructType ([StructField ('a' , IntegerType (), True ), StructField ('b' , IntegerType (), True )])
527527 assert type1 == expectedType
528528
529529 type2 = self .getFieldType (df .schema , "struct2" )
530- expectedType2 = StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType ())])
530+ expectedType2 = StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType (), False )])
531531 assert type2 == expectedType2
532532
533533 def test_inferred_column_structs2 (self , setupLogging ):
@@ -551,13 +551,13 @@ def test_inferred_column_structs2(self, setupLogging):
551551 df = df_spec .build ()
552552
553553 type1 = self .getFieldType (df .schema , "struct1" )
554- assert type1 == StructType ([StructField ('a' , IntegerType ()), StructField ('b' , IntegerType ())])
554+ assert type1 == StructType ([StructField ('a' , IntegerType (), True ), StructField ('b' , IntegerType (), True )])
555555 type2 = self .getFieldType (df .schema , "struct2" )
556- assert type2 == StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType ())])
556+ assert type2 == StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType (), False )])
557557 type3 = self .getFieldType (df .schema , "struct3" )
558558 assert type3 == StructType (
559- [StructField ('a' , StructType ([StructField ('a' , IntegerType ()), StructField ('b' , IntegerType ())]), False ),
560- StructField ('b' , StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType ())]), False )]
559+ [StructField ('a' , StructType ([StructField ('a' , IntegerType (), True ), StructField ('b' , IntegerType (), True )]), False ),
560+ StructField ('b' , StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType (), False )]), False )]
561561 )
562562
563563 def test_with_struct_column1 (self , setupLogging ):
@@ -580,9 +580,9 @@ def test_with_struct_column1(self, setupLogging):
580580 df = df_spec .build ()
581581
582582 type1 = self .getFieldType (df .schema , "struct1" )
583- assert type1 == StructType ([StructField ('a' , IntegerType ()), StructField ('b' , IntegerType ())])
583+ assert type1 == StructType ([StructField ('a' , IntegerType (), True ), StructField ('b' , IntegerType (), True )])
584584 type2 = self .getFieldType (df .schema , "struct2" )
585- assert type2 == StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType ())])
585+ assert type2 == StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType (), False )])
586586
587587 def test_with_struct_column2 (self , setupLogging ):
588588 column_count = 10
@@ -604,9 +604,9 @@ def test_with_struct_column2(self, setupLogging):
604604 df = df_spec .build ()
605605
606606 type1 = self .getFieldType (df .schema , "struct1" )
607- assert type1 == StructType ([StructField ('code1' , IntegerType ()), StructField ('code2' , IntegerType ())])
607+ assert type1 == StructType ([StructField ('code1' , IntegerType (), True ), StructField ('code2' , IntegerType (), True )])
608608 type2 = self .getFieldType (df .schema , "struct2" )
609- assert type2 == StructType ([StructField ('code5' , DateType (), False ), StructField ('code6' , StringType ())])
609+ assert type2 == StructType ([StructField ('code5' , DateType (), False ), StructField ('code6' , StringType (), False )])
610610
611611 def test_with_json_struct_column (self , setupLogging ):
612612 column_count = 10
@@ -680,13 +680,13 @@ def test_with_struct_column3(self, setupLogging):
680680 df = df_spec .build ()
681681
682682 type1 = self .getFieldType (df .schema , "struct1" )
683- assert type1 == StructType ([StructField ('a' , IntegerType ()), StructField ('b' , IntegerType ())])
683+ assert type1 == StructType ([StructField ('a' , IntegerType (), True ), StructField ('b' , IntegerType (), True )])
684684 type2 = self .getFieldType (df .schema , "struct2" )
685- assert type2 == StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType ())])
685+ assert type2 == StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType (), False )])
686686 type3 = self .getFieldType (df .schema , "struct3" )
687687 assert type3 == StructType (
688- [StructField ('a' , StructType ([StructField ('a' , IntegerType ()), StructField ('b' , IntegerType ())]), False ),
689- StructField ('b' , StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType ())]),
688+ [StructField ('a' , StructType ([StructField ('a' , IntegerType (), True ), StructField ('b' , IntegerType (), True )]), False ),
689+ StructField ('b' , StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType (), False )]),
690690 False )])
691691
692692 def test_with_struct_column4 (self , setupLogging ):
@@ -711,13 +711,13 @@ def test_with_struct_column4(self, setupLogging):
711711 df = df_spec .build ()
712712
713713 type1 = self .getFieldType (df .schema , "struct1" )
714- assert type1 == StructType ([StructField ('a' , IntegerType ()), StructField ('b' , IntegerType ())])
714+ assert type1 == StructType ([StructField ('a' , IntegerType (), True ), StructField ('b' , IntegerType (), True )])
715715 type2 = self .getFieldType (df .schema , "struct2" )
716- assert type2 == StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType ())])
716+ assert type2 == StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType (), False )])
717717 type3 = self .getFieldType (df .schema , "struct3" )
718718 assert type3 == StructType (
719- [StructField ('a' , StructType ([StructField ('a' , IntegerType ()), StructField ('b' , IntegerType ())]), False ),
720- StructField ('b' , StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType ())]),
719+ [StructField ('a' , StructType ([StructField ('a' , IntegerType (), True ), StructField ('b' , IntegerType (), True )]), False ),
720+ StructField ('b' , StructType ([StructField ('a' , DateType (), False ), StructField ('b' , StringType (), False )]),
721721 False )])
722722
723723 def test_with_struct_column_err1 (self , setupLogging ):
0 commit comments