@@ -242,9 +242,9 @@ def __init__(self, elementType, containsNull=True):
242242 :param elementType: the data type of elements.
243243 :param containsNull: indicates whether the list contains None values.
244244
245- >>> ArrayType(StringType) == ArrayType(StringType, True)
245+ >>> ArrayType(StringType()) == ArrayType(StringType() , True)
246246 True
247- >>> ArrayType(StringType, False) == ArrayType(StringType)
247+ >>> ArrayType(StringType() , False) == ArrayType(StringType() )
248248 False
249249 """
250250 self .elementType = elementType
@@ -292,11 +292,11 @@ def __init__(self, keyType, valueType, valueContainsNull=True):
292292 :param valueContainsNull: indicates whether values contains
293293 null values.
294294
295- >>> (MapType(StringType, IntegerType)
296- ... == MapType(StringType, IntegerType, True))
295+ >>> (MapType(StringType() , IntegerType() )
296+ ... == MapType(StringType() , IntegerType() , True))
297297 True
298- >>> (MapType(StringType, IntegerType, False)
299- ... == MapType(StringType, FloatType))
298+ >>> (MapType(StringType() , IntegerType() , False)
299+ ... == MapType(StringType() , FloatType() ))
300300 False
301301 """
302302 self .keyType = keyType
@@ -348,11 +348,11 @@ def __init__(self, name, dataType, nullable=True, metadata=None):
348348 to simple type that can be serialized to JSON
349349 automatically
350350
351- >>> (StructField("f1", StringType, True)
352- ... == StructField("f1", StringType, True))
351+ >>> (StructField("f1", StringType() , True)
352+ ... == StructField("f1", StringType() , True))
353353 True
354- >>> (StructField("f1", StringType, True)
355- ... == StructField("f2", StringType, True))
354+ >>> (StructField("f1", StringType() , True)
355+ ... == StructField("f2", StringType() , True))
356356 False
357357 """
358358 self .name = name
@@ -393,13 +393,13 @@ class StructType(DataType):
393393 def __init__ (self , fields ):
394394 """Creates a StructType
395395
396- >>> struct1 = StructType([StructField("f1", StringType, True)])
397- >>> struct2 = StructType([StructField("f1", StringType, True)])
396+ >>> struct1 = StructType([StructField("f1", StringType() , True)])
397+ >>> struct2 = StructType([StructField("f1", StringType() , True)])
398398 >>> struct1 == struct2
399399 True
400- >>> struct1 = StructType([StructField("f1", StringType, True)])
401- >>> struct2 = StructType([StructField("f1", StringType, True),
402- ... [ StructField("f2", IntegerType, False)] ])
400+ >>> struct1 = StructType([StructField("f1", StringType() , True)])
401+ >>> struct2 = StructType([StructField("f1", StringType() , True),
402+ ... StructField("f2", IntegerType() , False)])
403403 >>> struct1 == struct2
404404 False
405405 """
0 commit comments