18
18
from pandas .errors import PerformanceWarning , UnsortedIndexError
19
19
from pandas .core .dtypes .dtypes import CategoricalDtype
20
20
from pandas .core .indexes .base import InvalidIndexError
21
- from pandas ._libs import lib
21
+ from pandas .core . dtypes . cast import construct_1d_array_from_listlike
22
22
from pandas ._libs .lib import Timestamp
23
23
24
24
import pandas .util .testing as tm
@@ -913,7 +913,7 @@ def test_from_product_invalid_input(self):
913
913
def test_from_product_datetimeindex (self ):
914
914
dt_index = date_range ('2000-01-01' , periods = 2 )
915
915
mi = pd .MultiIndex .from_product ([[1 , 2 ], dt_index ])
916
- etalon = lib . list_to_object_array ([(1 , pd .Timestamp (
916
+ etalon = construct_1d_array_from_listlike ([(1 , pd .Timestamp (
917
917
'2000-01-01' )), (1 , pd .Timestamp ('2000-01-02' )), (2 , pd .Timestamp (
918
918
'2000-01-01' )), (2 , pd .Timestamp ('2000-01-02' ))])
919
919
tm .assert_numpy_array_equal (mi .values , etalon )
@@ -940,7 +940,7 @@ def test_values_boxed(self):
940
940
(3 , pd .Timestamp ('2000-01-03' ))]
941
941
mi = pd .MultiIndex .from_tuples (tuples )
942
942
tm .assert_numpy_array_equal (mi .values ,
943
- lib . list_to_object_array (tuples ))
943
+ construct_1d_array_from_listlike (tuples ))
944
944
# Check that code branches for boxed values produce identical results
945
945
tm .assert_numpy_array_equal (mi .values [:4 ], mi [:4 ].values )
946
946
0 commit comments