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/08/26 09:06:36 UTC

[GitHub] [spark] itholic commented on a diff in pull request #37647: Fixed timestamp conversion on Windows

itholic commented on code in PR #37647:
URL: https://github.com/apache/spark/pull/37647#discussion_r955833929


##########
python/pyspark/sql/types.py:
##########
@@ -176,14 +177,36 @@ def needConversion(self):
 
     def toInternal(self, dt):
         if dt is not None:
-            seconds = (calendar.timegm(dt.utctimetuple()) if dt.tzinfo
-                       else time.mktime(dt.timetuple()))
+            if platform.system().lower() == "windows":
+                """
+                On Windows, the current value is converted to a timestamp
+                when the current value is less than 1970
+                """

Review Comment:
   docstring should be placed at the top of the function.
   
   I think we can just leave the multi-line comments in this case.



##########
python/pyspark/sql/types.py:
##########
@@ -498,20 +521,20 @@ def __init__(self, fields=None):
 
     def add(self, field, data_type=None, nullable=True, metadata=None):
         """
-        Construct a :class:`StructType` by adding new elements to it, to define the schema.
+        Construct a StructType by adding new elements to it, to define the schema.

Review Comment:
   qq: Why do we change this ?



-- 
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