If the optional metadata passed to `pyspark.sql.types.StructField` includes a pythonic `None`, the `pyspark.SparkContext.createDataFrame` will fail with a very cryptic/unhelpful error.
Here is a minimal reproducible example:
This produces the following ~stacktrace:
I believe the most important line of the traceback is this one:
But it wasn't enough for me to figure out the problem; I had to steadily simplify my program until I could identify what caused the problem.