-
Notifications
You must be signed in to change notification settings - Fork 28.1k
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
[SPARK-10162] [SQL] Fix the timezone omitting for PySpark Dataframe filter function #8555
Conversation
Jenkins, this is ok to test. |
Test build #41876 has finished for PR 8555 at commit
|
|
||
seconds = (calendar.timegm(obj.utctimetuple()) if obj.tzinfo | ||
else time.mktime(obj.timetuple())) | ||
return Timestamp(int(seconds) * 1000 + obj.microsecond // 1000) |
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.
Existing: We should include microseconds by
t = Timestamp(int(seconds) * 1000)
t.setNanos(obj.microsecond * 1000)
return t
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.
Fixed in commit 2acd285
Test build #41880 has finished for PR 8555 at commit
|
Test build #41885 has finished for PR 8555 at commit
|
LGTM, merging this into master. |
This PR addresses SPARK-10162
The issue is with DataFrame filter() function, if datetime.datetime is passed to it:
Fix includes both code change and regression test. Problem reproduction code on master:
It gives the same timestamp ignoring time zone:
After the fix:
PR 8536 was occasionally closed by me dropping the repo