Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Davies Liu committed Feb 27, 2015
1 parent d9ae973 commit 46999dc
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions python/pyspark/sql/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ def __init__(self, elementType, containsNull=True):
:param elementType: the data type of elements.
:param containsNull: indicates whether the list contains None values.
>>> ArrayType(StringType) == ArrayType(StringType, True)
>>> ArrayType(StringType()) == ArrayType(StringType(), True)
True
>>> ArrayType(StringType, False) == ArrayType(StringType)
>>> ArrayType(StringType(), False) == ArrayType(StringType())
False
"""
self.elementType = elementType
Expand Down Expand Up @@ -292,11 +292,11 @@ def __init__(self, keyType, valueType, valueContainsNull=True):
:param valueContainsNull: indicates whether values contains
null values.
>>> (MapType(StringType, IntegerType)
... == MapType(StringType, IntegerType, True))
>>> (MapType(StringType(), IntegerType())
... == MapType(StringType(), IntegerType(), True))
True
>>> (MapType(StringType, IntegerType, False)
... == MapType(StringType, FloatType))
>>> (MapType(StringType(), IntegerType(), False)
... == MapType(StringType(), FloatType()))
False
"""
self.keyType = keyType
Expand Down Expand Up @@ -348,11 +348,11 @@ def __init__(self, name, dataType, nullable=True, metadata=None):
to simple type that can be serialized to JSON
automatically
>>> (StructField("f1", StringType, True)
... == StructField("f1", StringType, True))
>>> (StructField("f1", StringType(), True)
... == StructField("f1", StringType(), True))
True
>>> (StructField("f1", StringType, True)
... == StructField("f2", StringType, True))
>>> (StructField("f1", StringType(), True)
... == StructField("f2", StringType(), True))
False
"""
self.name = name
Expand Down Expand Up @@ -393,13 +393,13 @@ class StructType(DataType):
def __init__(self, fields):
"""Creates a StructType
>>> struct1 = StructType([StructField("f1", StringType, True)])
>>> struct2 = StructType([StructField("f1", StringType, True)])
>>> struct1 = StructType([StructField("f1", StringType(), True)])
>>> struct2 = StructType([StructField("f1", StringType(), True)])
>>> struct1 == struct2
True
>>> struct1 = StructType([StructField("f1", StringType, True)])
>>> struct2 = StructType([StructField("f1", StringType, True),
... [StructField("f2", IntegerType, False)]])
>>> struct1 = StructType([StructField("f1", StringType(), True)])
>>> struct2 = StructType([StructField("f1", StringType(), True),
... StructField("f2", IntegerType(), False)])
>>> struct1 == struct2
False
"""
Expand Down

0 comments on commit 46999dc

Please sign in to comment.