Skip to content

Commit 1e2abcf

Browse files
committed
change default value of metadata to None in python
1 parent 611d3c2 commit 1e2abcf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/pyspark/sql.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ class StructField(DataType):
305305
306306
"""
307307

308-
def __init__(self, name, dataType, nullable, metadata={}):
308+
def __init__(self, name, dataType, nullable, metadata=None):
309309
"""Creates a StructField
310310
:param name: the name of this field.
311311
:param dataType: the data type of this field.
@@ -325,7 +325,7 @@ def __init__(self, name, dataType, nullable, metadata={}):
325325
self.name = name
326326
self.dataType = dataType
327327
self.nullable = nullable
328-
self.metadata = metadata
328+
self.metadata = metadata or {}
329329

330330
def __repr__(self):
331331
return "StructField(%s,%s,%s)" % (self.name, self.dataType,

0 commit comments

Comments
 (0)