-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-24673][SQL][PYTHON][FOLLOWUP] Support Column arguments in timezone of from_utc_timestamp/to_utc_timestamp #21723
New issue
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
Conversation
HyukjinKwon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems from_utc_timestamp is missed.
python/pyspark/sql/functions.py
Outdated
| return Column(sc._jvm.functions.to_utc_timestamp(_to_java_column(timestamp), tz)) | ||
|
|
||
| if isinstance(tz, Column): | ||
| timezone = _to_java_column(tz) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maropu, not a big deal at all but mind tz = _to_java_column(tz) to reduce the diff?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
| """ | ||
| Given a timestamp like '2017-07-14 02:40:00.0', interprets it as a time in the given time | ||
| zone, and renders that time as a timestamp in UTC. For example, 'GMT+1' would yield | ||
| '2017-07-14 01:40:00.0'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have thought about this for long time and let's start to describe what we change within Python side:
:param timestamp: the column that contains timestamps
:param tz: a string that has the ID of timezone, e.g. "GMT", "America/Los_Angeles", etc.
.. versionchanged:: 2.4
`tz` can take a :class:`Column` containing timezone ID strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
Test build #92667 has finished for PR 21723 at commit
|
|
oh, sorry, I'll update soon. |
|
Test build #92677 has finished for PR 21723 at commit
|
HyukjinKwon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@maropu, are you online? mind if I ask to fix PR title and description before I merge this one? |
|
ah, ok. I’ll update soon |
|
@HyukjinKwon ok, fixed! |
|
Merged to master. |
|
Thanks, @maropu. |
What changes were proposed in this pull request?
This pr supported column arguments in timezone of
from_utc_timestamp/to_utc_timestamp(follow-up of #21693).How was this patch tested?
Added tests.