You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/10/19 03:13:04 UTC

[GitHub] [spark] HyukjinKwon commented on a diff in pull request #38285: [SPARK-40820][PYTHON] Creating StructType from Json

HyukjinKwon commented on code in PR #38285:
URL: https://github.com/apache/spark/pull/38285#discussion_r998901339


##########
python/pyspark/sql/types.py:
##########
@@ -653,8 +653,8 @@ def fromJson(cls, json: Dict[str, Any]) -> "StructField":
         return StructField(
             json["name"],
             _parse_datatype_json_value(json["type"]),
-            json["nullable"],
-            json["metadata"],
+            json.get("nullable", True),
+            json.get("metadata"),

Review Comment:
   When is this not set? This JSON ser/de is an internal format and not meant to be used by end users directly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org