@@ -1579,11 +1579,11 @@ def test_convert_non_ns(self):
1579
1579
tm .assert_series_equal (ser , expected )
1580
1580
1581
1581
# try to construct from a sequence asking for non-ns timedelta64
1582
- with pytest .raises (TypeError , match = r"Only \[ns\] granularity" ):
1582
+ with pytest .raises (TypeError , match = r"Only \[ns\] granularity is supported " ):
1583
1583
Series ([1000000 , 200000 , 3000000 ], dtype = "timedelta64[s]" )
1584
1584
1585
1585
# try to construct from a sequence asking for non-ns datetime64
1586
- with pytest .raises (TypeError , match = r"Only \[ns\] granularity" ):
1586
+ with pytest .raises (TypeError , match = r"Only \[ns\] granularity is supported " ):
1587
1587
Series ([1000000 , 200000 , 3000000 ], dtype = "datetime64[s]" )
1588
1588
1589
1589
@pytest .mark .parametrize (
@@ -1650,8 +1650,8 @@ def test_constructor_generic_timestamp_no_frequency(self, dtype, request):
1650
1650
@pytest .mark .parametrize (
1651
1651
"dtype,msg" ,
1652
1652
[
1653
- ("m8[ps]" , "cannot convert timedeltalike " ),
1654
- ("M8[ps]" , "cannot convert datetimelike " ),
1653
+ ("m8[ps]" , "Only \[ns\] granularity is supported " ),
1654
+ ("M8[ps]" , "Only \[ns\] granularity is supported " ),
1655
1655
],
1656
1656
)
1657
1657
def test_constructor_generic_timestamp_bad_frequency (self , dtype , msg ):
@@ -1894,22 +1894,6 @@ def test_constructor_dtype_timedelta_alternative_construct(self):
1894
1894
expected = Series (pd .to_timedelta ([1000000 , 200000 , 3000000 ], unit = "ns" ))
1895
1895
tm .assert_series_equal (result , expected )
1896
1896
1897
- def test_constructor_dtype_timedelta_ns_s (self ):
1898
- # GH#35465
1899
- result = Series ([1000000 , 200000 , 3000000 ], dtype = "timedelta64[ns]" )
1900
- expected = Series ([1000000 , 200000 , 3000000 ], dtype = "timedelta64[s]" )
1901
- tm .assert_series_equal (result , expected )
1902
-
1903
- def test_constructor_dtype_timedelta_ns_s_astype_int64 (self ):
1904
- # GH#35465
1905
- result = Series ([1000000 , 200000 , 3000000 ], dtype = "timedelta64[ns]" ).astype (
1906
- "int64"
1907
- )
1908
- expected = Series ([1000000 , 200000 , 3000000 ], dtype = "timedelta64[s]" ).astype (
1909
- "int64"
1910
- )
1911
- tm .assert_series_equal (result , expected )
1912
-
1913
1897
@pytest .mark .filterwarnings (
1914
1898
"ignore:elementwise comparison failed:DeprecationWarning"
1915
1899
)
0 commit comments