We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
snowpark-python/src/snowflake/snowpark/functions.py
Line 3819 in 44a8e17
The documentation of the daydiff function states that the result is the difference between col2 and col1.
"""Calculates the difference between two dates, or timestamp columns based in days. The result will reflect the difference between col2 - col1 """
Whereas it actually is the difference between col1 and col2.
""" Example:: >>> from snowflake.snowpark.functions import daydiff, to_date >>> df = session.createDataFrame([("2015-04-08", "2015-05-10")], ["d1", "d2"]) >>> res = df.select(daydiff(to_date(df.d2), to_date(df.d1)).alias("diff")).show() ---------- |"DIFF" | ---------- |32 | ---------- """
I understand that this is the intended behaviour.
#730
So I ask that the documentation is updated in order to make the actual behaviour clear.
"""Calculates the difference between two dates, or timestamp columns based in days. The result will reflect the difference between col1 - col2
Example:: >>> from snowflake.snowpark.functions import daydiff, to_date >>> df = session.createDataFrame([("2015-04-08", "2015-05-10")], ["d1", "d2"]) >>> res = df.select(daydiff(to_date(df.d2), to_date(df.d1)).alias("diff")).show() ---------- |"DIFF" | ---------- |32 | ---------- """
The text was updated successfully, but these errors were encountered:
Thanks for pointing this out @julienripoche
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
snowpark-python/src/snowflake/snowpark/functions.py
Line 3819 in 44a8e17
The documentation of the daydiff function states that the result is the difference between col2 and col1.
"""Calculates the difference between two dates, or timestamp columns based in days.
The result will reflect the difference between col2 - col1
"""
Whereas it actually is the difference between col1 and col2.
"""
Example::
>>> from snowflake.snowpark.functions import daydiff, to_date
>>> df = session.createDataFrame([("2015-04-08", "2015-05-10")], ["d1", "d2"])
>>> res = df.select(daydiff(to_date(df.d2), to_date(df.d1)).alias("diff")).show()
----------
|"DIFF" |
----------
|32 |
----------
"""
I understand that this is the intended behaviour.
#730
So I ask that the documentation is updated in order to make the actual behaviour clear.
"""Calculates the difference between two dates, or timestamp columns based in days.
The result will reflect the difference between col1 - col2
Example::
>>> from snowflake.snowpark.functions import daydiff, to_date
>>> df = session.createDataFrame([("2015-04-08", "2015-05-10")], ["d1", "d2"])
>>> res = df.select(daydiff(to_date(df.d2), to_date(df.d1)).alias("diff")).show()
----------
|"DIFF" |
----------
|32 |
----------
"""
The text was updated successfully, but these errors were encountered: