@@ -329,13 +329,15 @@ def _simple_new(cls, values, freq=None, dtype=None):
329
329
@classmethod
330
330
def _from_sequence (cls , data , dtype = None , copy = False ,
331
331
tz = None , freq = None ,
332
- dayfirst = False , yearfirst = False , ambiguous = 'raise' ):
332
+ dayfirst = False , yearfirst = False , ambiguous = 'raise' ,
333
+ int_as_wall_time = False ):
333
334
334
335
freq , freq_infer = dtl .maybe_infer_freq (freq )
335
336
336
337
subarr , tz , inferred_freq = sequence_to_dt64ns (
337
338
data , dtype = dtype , copy = copy , tz = tz ,
338
- dayfirst = dayfirst , yearfirst = yearfirst , ambiguous = ambiguous )
339
+ dayfirst = dayfirst , yearfirst = yearfirst ,
340
+ ambiguous = ambiguous , int_as_wall_time = int_as_wall_time )
339
341
340
342
freq , freq_infer = dtl .validate_inferred_freq (freq , inferred_freq ,
341
343
freq_infer )
@@ -1634,9 +1636,11 @@ def to_julian_date(self):
1634
1636
# -------------------------------------------------------------------
1635
1637
# Constructor Helpers
1636
1638
1639
+
1637
1640
def sequence_to_dt64ns (data , dtype = None , copy = False ,
1638
1641
tz = None ,
1639
- dayfirst = False , yearfirst = False , ambiguous = 'raise' ):
1642
+ dayfirst = False , yearfirst = False , ambiguous = 'raise' ,
1643
+ int_as_wall_time = False ):
1640
1644
"""
1641
1645
Parameters
1642
1646
----------
@@ -1662,7 +1666,6 @@ def sequence_to_dt64ns(data, dtype=None, copy=False,
1662
1666
------
1663
1667
TypeError : PeriodDType data is passed
1664
1668
"""
1665
-
1666
1669
inferred_freq = None
1667
1670
1668
1671
dtype = _validate_dt64_dtype (dtype )
@@ -1733,6 +1736,12 @@ def sequence_to_dt64ns(data, dtype=None, copy=False,
1733
1736
# assume this data are epoch timestamps
1734
1737
if data .dtype != _INT64_DTYPE :
1735
1738
data = data .astype (np .int64 , copy = False )
1739
+ if int_as_wall_time and tz is not None :
1740
+ warnings .warn ("test" , FutureWarning )
1741
+ tz = timezones .maybe_get_tz (tz )
1742
+ data = conversion .tz_localize_to_utc (data .view ('i8' ), tz ,
1743
+ ambiguous = ambiguous )
1744
+ data = data .view (_NS_DTYPE )
1736
1745
result = data .view (_NS_DTYPE )
1737
1746
1738
1747
if copy :
0 commit comments