Github user HyukjinKwon commented on a diff in the pull request: https://github.com/apache/spark/pull/19246#discussion_r139872337 --- Diff: python/pyspark/sql/types.py --- @@ -410,6 +410,24 @@ def __init__(self, name, dataType, nullable=True, metadata=None): self.dataType = dataType self.nullable = nullable self.metadata = metadata or {} + self.needConversion = dataType.needConversion + self.toInternal = dataType.toInternal + self.fromInternal = dataType.fromInternal + + def __getstate__(self): + """Return state values to be pickled.""" + return (self.name, self.dataType, self.nullable, self.metadata) + + def __setstate__(self, state): + """Restore state from the unpickled state values.""" + name, dataType, nullable, metadata = state + self.name = name + self.dataType = dataType + self.nullable = nullable + self.metadata = metadata + self.needConversion = dataType.needConversion --- End diff -- Ah, I think @maver1ck did this with https://github.com/apache/spark/pull/19249 I guess. I ran the same code in the PR description. Will double check and be back with some commands I ran.
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org