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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]