File tree Expand file tree Collapse file tree 5 files changed +17
-11
lines changed Expand file tree Collapse file tree 5 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Other Enhancements
2222^^^^^^^^^^^^^^^^^^
2323
2424- :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+ -
2626-
2727
2828.. _whatsnew_0211.deprecations:
@@ -65,7 +65,7 @@ Bug Fixes
6565Conversion
6666^^^^^^^^^^
6767
68- - Bug in :attr:`Timestamp.weekday_name` and :attr:`DatetimeIndex.weekday_name` not returning locale aware values (:issue:`12806`)
68+ -
6969-
7070-
7171
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ Other Enhancements
2323^^^^^^^^^^^^^^^^^^
2424
2525- 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`)
2727-
2828
2929.. _whatsnew_0220.api_breaking:
@@ -94,7 +94,7 @@ Bug Fixes
9494Conversion
9595^^^^^^^^^^
9696
97- -
97+ - Bug in :attr:`Timestamp.weekday_name` and :attr:`DatetimeIndex.weekday_name` not returning locale aware values (:issue:`12806`)
9898-
9999-
100100
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ cdef int64_t NPY_NAT = util.get_nat()
3030
3131from pandas._libs.tslibs.strptime import LocaleTime
3232
33+
3334def build_field_sarray (ndarray[int64_t] dtindex ):
3435 """
3536 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):
328328 assert [d .weekofyear for d in dates ] == expected
329329
330330 # 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 ,
332332 reason = 'No available locales' )
333333 @pytest .mark .parametrize ('time_locale' , tm .get_locales ())
334334 def test_datetime_name_accessors (self , time_locale ):
Original file line number Diff line number Diff line change 11""" test the scalar Timestamp """
22
33import sys
4+ import locale
45import pytz
56import pytest
67import dateutil
@@ -597,13 +598,17 @@ def check(value, equal):
597598 for end in ends :
598599 assert getattr (ts , end )
599600
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 ):
605609 # 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 ()
607612
608613 def test_pprint (self ):
609614 # GH12622
You can’t perform that action at this time.
0 commit comments