arrow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject arrow git commit: ARROW-433: Correctly handle Arrow to Python date conversion for timezones west of London
Date Tue, 20 Dec 2016 19:08:14 GMT
Repository: arrow
Updated Branches:
  refs/heads/master fe53fa409 -> 6ff5fcf1b


ARROW-433: Correctly handle Arrow to Python date conversion for timezones west of London

Verified with `TZ='America/New_York' py.test pyarrow`

Author: Uwe L. Korn <uwelk@xhochy.com>

Closes #245 from xhochy/ARROW-433 and squashes the following commits:

06745d8 [Uwe L. Korn] Use more pythonic approach
a55be24 [Uwe L. Korn] ARROW-433: Correctly handle Arrow to Python date conversion for timezones
west of London


Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/6ff5fcf1
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/6ff5fcf1
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/6ff5fcf1

Branch: refs/heads/master
Commit: 6ff5fcf1bfb67d817d6261596d47cf6a6d9c3c6c
Parents: fe53fa4
Author: Uwe L. Korn <uwelk@xhochy.com>
Authored: Tue Dec 20 14:08:07 2016 -0500
Committer: Wes McKinney <wes.mckinney@twosigma.com>
Committed: Tue Dec 20 14:08:07 2016 -0500

----------------------------------------------------------------------
 python/pyarrow/scalar.pyx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/arrow/blob/6ff5fcf1/python/pyarrow/scalar.pyx
----------------------------------------------------------------------
diff --git a/python/pyarrow/scalar.pyx b/python/pyarrow/scalar.pyx
index 09f60e2..623e3e4 100644
--- a/python/pyarrow/scalar.pyx
+++ b/python/pyarrow/scalar.pyx
@@ -127,7 +127,7 @@ cdef class DateValue(ArrayValue):
 
     def as_py(self):
         cdef CDateArray* ap = <CDateArray*> self.sp_array.get()
-        return datetime.date.fromtimestamp(ap.Value(self.index) / 1000)
+        return datetime.datetime.utcfromtimestamp(ap.Value(self.index) / 1000).date()
 
 
 cdef class TimestampValue(ArrayValue):


Mime
View raw message