@@ -6,7 +6,6 @@ construction requirements, we need to do object instantiation in python
6
6
(see Timestamp class below). This will serve as a C extension type that
7
7
shadows the python class, where we do any heavy lifting.
8
8
"""
9
- import inspect
10
9
import warnings
11
10
12
11
cimport cython
@@ -251,7 +250,7 @@ cdef class _Timestamp(ABCTimestamp):
251
250
warnings.warn(
252
251
" Timestamp.freq is deprecated and will be removed in a future version." ,
253
252
FutureWarning ,
254
- stacklevel = find_stack_level(inspect.currentframe() ),
253
+ stacklevel = find_stack_level(),
255
254
)
256
255
return self ._freq
257
256
@@ -371,7 +370,7 @@ cdef class _Timestamp(ABCTimestamp):
371
370
" In a future version these will be considered non-comparable. "
372
371
" Use 'ts == pd.Timestamp(date)' or 'ts.date() == date' instead." ,
373
372
FutureWarning ,
374
- stacklevel = find_stack_level(inspect.currentframe() ),
373
+ stacklevel = find_stack_level(),
375
374
)
376
375
return NotImplemented
377
376
else :
@@ -626,7 +625,7 @@ cdef class _Timestamp(ABCTimestamp):
626
625
" version. When you have a freq, use "
627
626
f" freq.{field}(timestamp) instead." ,
628
627
FutureWarning ,
629
- stacklevel = find_stack_level(inspect.currentframe() ),
628
+ stacklevel = find_stack_level(),
630
629
)
631
630
632
631
@property
@@ -1132,7 +1131,7 @@ cdef class _Timestamp(ABCTimestamp):
1132
1131
"""
1133
1132
if self .nanosecond != 0 and warn:
1134
1133
warnings.warn(" Discarding nonzero nanoseconds in conversion." ,
1135
- UserWarning , stacklevel = find_stack_level(inspect.currentframe() ))
1134
+ UserWarning , stacklevel = find_stack_level())
1136
1135
1137
1136
return datetime(self .year, self .month, self .day,
1138
1137
self .hour, self .minute, self .second,
@@ -1211,7 +1210,7 @@ cdef class _Timestamp(ABCTimestamp):
1211
1210
warnings.warn(
1212
1211
" Converting to Period representation will drop timezone information." ,
1213
1212
UserWarning ,
1214
- stacklevel = find_stack_level(inspect.currentframe() ),
1213
+ stacklevel = find_stack_level(),
1215
1214
)
1216
1215
1217
1216
if freq is None :
@@ -1220,7 +1219,7 @@ cdef class _Timestamp(ABCTimestamp):
1220
1219
" In a future version, calling 'Timestamp.to_period()' without "
1221
1220
" passing a 'freq' will raise an exception." ,
1222
1221
FutureWarning ,
1223
- stacklevel = find_stack_level(inspect.currentframe() ),
1222
+ stacklevel = find_stack_level(),
1224
1223
)
1225
1224
1226
1225
return Period(self , freq = freq)
@@ -1412,7 +1411,7 @@ class Timestamp(_Timestamp):
1412
1411
" Timestamp.utcfromtimestamp(ts).tz_localize(None). "
1413
1412
" To get the future behavior, use Timestamp.fromtimestamp(ts, 'UTC')" ,
1414
1413
FutureWarning ,
1415
- stacklevel = find_stack_level(inspect.currentframe() ),
1414
+ stacklevel = find_stack_level(),
1416
1415
)
1417
1416
return cls (datetime.utcfromtimestamp(ts))
1418
1417
@@ -1648,7 +1647,7 @@ class Timestamp(_Timestamp):
1648
1647
" as a wall time, not a UTC time. To interpret as a UTC time, "
1649
1648
" use `Timestamp(dt64).tz_localize('UTC').tz_convert(tz)`" ,
1650
1649
FutureWarning ,
1651
- stacklevel = find_stack_level(inspect.currentframe() ),
1650
+ stacklevel = find_stack_level(),
1652
1651
)
1653
1652
# Once this deprecation is enforced, we can do
1654
1653
# return Timestamp(ts_input).tz_localize(tzobj)
@@ -1671,7 +1670,7 @@ class Timestamp(_Timestamp):
1671
1670
" The 'freq' argument in Timestamp is deprecated and will be "
1672
1671
" removed in a future version." ,
1673
1672
FutureWarning ,
1674
- stacklevel = find_stack_level(inspect.currentframe() ),
1673
+ stacklevel = find_stack_level(),
1675
1674
)
1676
1675
if not is_offset_object(freq):
1677
1676
freq = to_offset(freq)
@@ -2007,7 +2006,7 @@ timedelta}, default 'raise'
2007
2006
warnings.warn(
2008
2007
" Timestamp.freqstr is deprecated and will be removed in a future version." ,
2009
2008
FutureWarning ,
2010
- stacklevel = find_stack_level(inspect.currentframe() ),
2009
+ stacklevel = find_stack_level(),
2011
2010
)
2012
2011
return self ._freqstr
2013
2012
0 commit comments