Skip to content

Commit 14c0fce

Browse files
committed
Type ctype variables and functions, whatsnew fix
1 parent 594177c commit 14c0fce

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

doc/source/whatsnew/v0.21.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ Conversion
367367
- Fixed the return type of ``IntervalIndex.is_non_overlapping_monotonic`` to be a Python ``bool`` for consistency with similar attributes/methods. Previously returned a ``numpy.bool_``. (:issue:`17237`)
368368
- Bug in ``IntervalIndex.is_non_overlapping_monotonic`` when intervals are closed on both sides and overlap at a point (:issue:`16560`)
369369
- Bug in :func:`Series.fillna` returns frame when ``inplace=True`` and ``value`` is dict (:issue:`16156`)
370-
- Bug in ``Timestamp.weekday_name`` returning a UTC-based weekday name when localized to a timezone (:issue:`17354`)
370+
- Bug in :attr:`Timestamp.weekday_name` returning a UTC-based weekday name when localized to a timezone (:issue:`17354`)
371371

372372
Indexing
373373
^^^^^^^^

pandas/_libs/tslib.pyx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1266,19 +1266,23 @@ cdef class _Timestamp(datetime):
12661266
# same timezone if specified)
12671267
return datetime.__sub__(self, other)
12681268

1269-
cpdef _maybe_convert_value_to_local(self):
1269+
cdef int64_t _maybe_convert_value_to_local(self):
12701270
"""Convert UTC i8 value to local i8 value if tz exists"
12711271
val = self.value
12721272
if self.tz is not None and not _is_utc(self.tz):
12731273
val = tz_convert_single(self.value, 'UTC', self.tz)
12741274
return val
12751275
12761276
cpdef _get_field(self, field):
1277+
cdef:
1278+
int64_t val
12771279
val = self._maybe_convert_value_to_local()
12781280
out = get_date_field(np.array([val], dtype=np.int64), field)
12791281
return int(out[0])
12801282
12811283
cpdef _get_named_field(self, field):
1284+
cdef:
1285+
int64_t val
12821286
val = self._maybe_convert_value_to_local()
12831287
out = get_date_name_field(np.array([val], dtype=np.int64), field)
12841288
return out[0]

0 commit comments

Comments
 (0)