[GitHub] [spark] MaxGekk commented on a change in pull request #27295: Fix src/dest type documentation for `to_timestamp`

2020-01-20 Thread GitBox
MaxGekk commented on a change in pull request #27295: Fix src/dest type 
documentation for `to_timestamp`
URL: https://github.com/apache/spark/pull/27295#discussion_r368693051
 
 

 ##
 File path: python/pyspark/sql/functions.py
 ##
 @@ -1161,7 +1161,7 @@ def to_date(col, format=None):
 @since(2.2)
 def to_timestamp(col, format=None):
 """Converts a :class:`Column` of :class:`pyspark.sql.types.StringType` or
-:class:`pyspark.sql.types.TimestampType` into 
:class:`pyspark.sql.types.DateType`
+:class:`pyspark.sql.types.DateType` into 
:class:`pyspark.sql.types.TimestampType`
 
 Review comment:
   Cannot the function accept values of `TimestampType` as well? Internally, 
the first parameter should be casted to `TimestampType`. If it is already a 
timestamp, should be ok.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [spark] MaxGekk commented on a change in pull request #27295: Fix src/dest type documentation for `to_timestamp`

2020-01-20 Thread GitBox
MaxGekk commented on a change in pull request #27295: Fix src/dest type 
documentation for `to_timestamp`
URL: https://github.com/apache/spark/pull/27295#discussion_r368710239
 
 

 ##
 File path: python/pyspark/sql/functions.py
 ##
 @@ -1161,7 +1161,7 @@ def to_date(col, format=None):
 @since(2.2)
 def to_timestamp(col, format=None):
 """Converts a :class:`Column` of :class:`pyspark.sql.types.StringType` or
-:class:`pyspark.sql.types.TimestampType` into 
:class:`pyspark.sql.types.DateType`
+:class:`pyspark.sql.types.DateType` into 
:class:`pyspark.sql.types.TimestampType`
 
 Review comment:
   `CAST` can accept not only `DateType` but others, see 
https://github.com/apache/spark/blob/e0efd213eb6ff61ce2b0f54f55201899fa4171a6/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/Cast.scala#L423-L447
   you can:
   1. mention all those types in the comment, or
   2. say that any types supported by `CAST` while converting to 
`TimestampType`, for instance `DateType`.
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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