File tree 5 files changed +17
-11
lines changed
5 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Other Enhancements
22
22
^^^^^^^^^^^^^^^^^^
23
23
24
24
- :meth:`Timestamp.timestamp` is now available in Python 2.7. (:issue:`17329`)
25
- - :attr:`Timestamp.month_name`, :attr:`DatetimeIndex.month_name`, and :attr:`Series.dt.month_name` are now available (:issue:`12805`)
25
+ -
26
26
-
27
27
28
28
.. _whatsnew_0211.deprecations:
@@ -65,7 +65,7 @@ Bug Fixes
65
65
Conversion
66
66
^^^^^^^^^^
67
67
68
- - Bug in :attr:`Timestamp.weekday_name` and :attr:`DatetimeIndex.weekday_name` not returning locale aware values (:issue:`12806`)
68
+ -
69
69
-
70
70
-
71
71
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ Other Enhancements
23
23
^^^^^^^^^^^^^^^^^^
24
24
25
25
- Better support for ``Dataframe.style.to_excel()`` output with the ``xlsxwriter`` engine. (:issue:`16149`)
26
- -
26
+ - :attr:`Timestamp.month_name`, :attr:`DatetimeIndex.month_name`, and :attr:`Series.dt.month_name` are now available (:issue:`12805`)
27
27
-
28
28
29
29
.. _whatsnew_0220.api_breaking:
@@ -94,7 +94,7 @@ Bug Fixes
94
94
Conversion
95
95
^^^^^^^^^^
96
96
97
- -
97
+ - Bug in :attr:`Timestamp.weekday_name` and :attr:`DatetimeIndex.weekday_name` not returning locale aware values (:issue:`12806`)
98
98
-
99
99
-
100
100
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ cdef int64_t NPY_NAT = util.get_nat()
30
30
31
31
from pandas._libs.tslibs.strptime import LocaleTime
32
32
33
+
33
34
def build_field_sarray (ndarray[int64_t] dtindex ):
34
35
"""
35
36
Datetime as int64 representation to a structured array of fields
Original file line number Diff line number Diff line change @@ -328,7 +328,7 @@ def test_datetimeindex_accessors(self):
328
328
assert [d .weekofyear for d in dates ] == expected
329
329
330
330
# GH 12806
331
- @pytest .mark .skipif (len (tm .get_locales ()) == 0 ,
331
+ @pytest .mark .skipif (tm . get_locales () is None or len (tm .get_locales ()) == 0 ,
332
332
reason = 'No available locales' )
333
333
@pytest .mark .parametrize ('time_locale' , tm .get_locales ())
334
334
def test_datetime_name_accessors (self , time_locale ):
Original file line number Diff line number Diff line change 1
1
""" test the scalar Timestamp """
2
2
3
3
import sys
4
+ import locale
4
5
import pytz
5
6
import pytest
6
7
import dateutil
@@ -597,13 +598,17 @@ def check(value, equal):
597
598
for end in ends :
598
599
assert getattr (ts , end )
599
600
600
- @pytest .mark .parametrize ('data, expected' ,
601
- [(Timestamp ('2017-08-28 23:00:00' ), 'Monday' ),
602
- (Timestamp ('2017-08-28 23:00:00' , tz = 'EST' ),
603
- 'Monday' )])
604
- def test_weekday_name (self , data , expected ):
601
+ # GH 12806
602
+ @pytest .mark .skipif (tm .get_locales () is None or len (tm .get_locales ()) == 0 ,
603
+ reason = 'No available locales' )
604
+ @pytest .mark .parametrize ('data' ,
605
+ [Timestamp ('2017-08-28 23:00:00' ),
606
+ Timestamp ('2017-08-28 23:00:00' , tz = 'EST' )])
607
+ @pytest .mark .parametrize ('time_locale' , tm .get_locales ())
608
+ def test_weekday_name (self , data , time_locale ):
605
609
# GH 17354
606
- assert data .weekday_name == expected
610
+ with tm .set_locale (time_locale , locale .LC_TIME ):
611
+ assert data .weekday_name == calendar .day_name [0 ].capitalize ()
607
612
608
613
def test_pprint (self ):
609
614
# GH12622
You can’t perform that action at this time.
0 commit comments