88import pandas as pd
99import pandas ._testing as tm
1010from pandas .core .arrays import DatetimeArray
11- from pandas .core .arrays .datetimes import _sequence_to_dt64ns
1211
1312
1413class TestDatetimeArrayConstructor :
@@ -44,7 +43,6 @@ def test_freq_validation(self):
4443 "meth" ,
4544 [
4645 DatetimeArray ._from_sequence ,
47- _sequence_to_dt64ns ,
4846 pd .to_datetime ,
4947 pd .DatetimeIndex ,
5048 ],
@@ -104,9 +102,6 @@ def test_bool_dtype_raises(self):
104102 with pytest .raises (TypeError , match = msg ):
105103 DatetimeArray ._from_sequence (arr )
106104
107- with pytest .raises (TypeError , match = msg ):
108- _sequence_to_dt64ns (arr )
109-
110105 with pytest .raises (TypeError , match = msg ):
111106 pd .DatetimeIndex (arr )
112107
@@ -143,14 +138,12 @@ def test_tz_dtype_mismatch_raises(self):
143138 ["2000" ], dtype = DatetimeTZDtype (tz = "US/Central" )
144139 )
145140 with pytest .raises (TypeError , match = "data is already tz-aware" ):
146- DatetimeArray ._from_sequence_not_strict (
147- arr , dtype = DatetimeTZDtype (tz = "UTC" )
148- )
141+ DatetimeArray ._from_sequence (arr , dtype = DatetimeTZDtype (tz = "UTC" ))
149142
150143 def test_tz_dtype_matches (self ):
151144 dtype = DatetimeTZDtype (tz = "US/Central" )
152145 arr = DatetimeArray ._from_sequence (["2000" ], dtype = dtype )
153- result = DatetimeArray ._from_sequence_not_strict (arr , dtype = dtype )
146+ result = DatetimeArray ._from_sequence (arr , dtype = dtype )
154147 tm .assert_equal (arr , result )
155148
156149 @pytest .mark .parametrize ("order" , ["F" , "C" ])
@@ -160,13 +153,6 @@ def test_2d(self, order):
160153 if order == "F" :
161154 arr = arr .T
162155
163- res = _sequence_to_dt64ns (arr )
164- expected = _sequence_to_dt64ns (arr .ravel ())
165-
166- tm .assert_numpy_array_equal (res [0 ].ravel (), expected [0 ])
167- assert res [1 ] == expected [1 ]
168- assert res [2 ] == expected [2 ]
169-
170156 res = DatetimeArray ._from_sequence (arr )
171157 expected = DatetimeArray ._from_sequence (arr .ravel ()).reshape (arr .shape )
172158 tm .assert_datetime_array_equal (res , expected )
0 commit comments