@@ -632,13 +632,9 @@ def test_astype_tz_object_conversion(self, tz):
632
632
result = result .astype ({"tz" : "datetime64[ns, Europe/London]" })
633
633
tm .assert_frame_equal (result , expected )
634
634
635
- def test_astype_dt64_to_string (self , frame_or_series , tz_naive_fixture , request ):
635
+ def test_astype_dt64_to_string (self , frame_or_series , tz_naive_fixture ):
636
+ # GH#41409
636
637
tz = tz_naive_fixture
637
- if tz is None :
638
- mark = pytest .mark .xfail (
639
- reason = "GH#36153 uses ndarray formatting instead of DTA formatting"
640
- )
641
- request .node .add_marker (mark )
642
638
643
639
dti = date_range ("2016-01-01" , periods = 3 , tz = tz )
644
640
dta = dti ._data
@@ -660,6 +656,15 @@ def test_astype_dt64_to_string(self, frame_or_series, tz_naive_fixture, request)
660
656
alt = obj .astype (str )
661
657
assert np .all (alt .iloc [1 :] == result .iloc [1 :])
662
658
659
+ def test_astype_td64_to_string (self , frame_or_series ):
660
+ # GH#41409
661
+ tdi = pd .timedelta_range ("1 Day" , periods = 3 )
662
+ obj = frame_or_series (tdi )
663
+
664
+ expected = frame_or_series (["1 days" , "2 days" , "3 days" ], dtype = "string" )
665
+ result = obj .astype ("string" )
666
+ tm .assert_equal (result , expected )
667
+
663
668
def test_astype_bytes (self ):
664
669
# GH#39474
665
670
result = DataFrame (["foo" , "bar" , "baz" ]).astype (bytes )
0 commit comments