Why this is working just fine
from pyspark.sql.types import *
l=[("foo",83.33)]
schema = StructType([
StructField("type", StringType(), True),
StructField("value", DoubleType(), True)])
df= spark.createDataFrame(l,schema)
And this
l=[(83.33)]
schema = StructType([
StructField("value", DoubleType(), True)])
df= spark.createDataFrame(l,schema)
Gives me an error
StructType can not accept object 83.33 in type <class 'float'>