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 2019/10/03 06:31:34 UTC

[GitHub] [spark] MaxGekk commented on a change in pull request #25998: [SPARK-29328][SQL] Fix calculation of mean seconds per month

MaxGekk commented on a change in pull request #25998: [SPARK-29328][SQL] Fix calculation of mean seconds per month
URL: https://github.com/apache/spark/pull/25998#discussion_r330880476
 
 

 ##########
 File path: python/pyspark/sql/functions.py
 ##########
 @@ -1122,9 +1122,9 @@ def months_between(date1, date2, roundOff=True):
 
     >>> df = spark.createDataFrame([('1997-02-28 10:30:00', '1996-10-30')], ['date1', 'date2'])
     >>> df.select(months_between(df.date1, df.date2).alias('months')).collect()
 
 Review comment:
   The `months_between` is only particular case where the fix impacts on 3rd digit in the fractional part. I think it is more important to have more precise year/month duration in conversions of an interval to its duration in seconds (msec, usec) in other cases. Using 372 days per year leads to significant and visible errors in such conversions. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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