@@ -1704,20 +1704,25 @@ def test_unique_complex_numbers(self, array, expected):
17041704
17051705
17061706class TestHashTable :
1707- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
17081707 @pytest .mark .parametrize (
17091708 "htable, data" ,
17101709 [
1711- (ht .PyObjectHashTable , [f"foo_{ i } " for i in range (1000 )]),
1712- (ht .StringHashTable , [f"foo_{ i } " for i in range (1000 )]),
1710+ (
1711+ ht .PyObjectHashTable ,
1712+ np .array ([f"foo_{ i } " for i in range (1000 )], dtype = object ),
1713+ ),
1714+ (
1715+ ht .StringHashTable ,
1716+ np .array ([f"foo_{ i } " for i in range (1000 )], dtype = object ),
1717+ ),
17131718 (ht .Float64HashTable , np .arange (1000 , dtype = np .float64 )),
17141719 (ht .Int64HashTable , np .arange (1000 , dtype = np .int64 )),
17151720 (ht .UInt64HashTable , np .arange (1000 , dtype = np .uint64 )),
17161721 ],
17171722 )
17181723 def test_hashtable_unique (self , htable , data , writable ):
17191724 # output of maker has guaranteed unique elements
1720- s = Series (data )
1725+ s = Series (data , dtype = data . dtype )
17211726 if htable == ht .Float64HashTable :
17221727 # add NaN for float column
17231728 s .loc [500 ] = np .nan
@@ -1744,20 +1749,25 @@ def test_hashtable_unique(self, htable, data, writable):
17441749 reconstr = result_unique [result_inverse ]
17451750 tm .assert_numpy_array_equal (reconstr , s_duplicated .values )
17461751
1747- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
17481752 @pytest .mark .parametrize (
17491753 "htable, data" ,
17501754 [
1751- (ht .PyObjectHashTable , [f"foo_{ i } " for i in range (1000 )]),
1752- (ht .StringHashTable , [f"foo_{ i } " for i in range (1000 )]),
1755+ (
1756+ ht .PyObjectHashTable ,
1757+ np .array ([f"foo_{ i } " for i in range (1000 )], dtype = object ),
1758+ ),
1759+ (
1760+ ht .StringHashTable ,
1761+ np .array ([f"foo_{ i } " for i in range (1000 )], dtype = object ),
1762+ ),
17531763 (ht .Float64HashTable , np .arange (1000 , dtype = np .float64 )),
17541764 (ht .Int64HashTable , np .arange (1000 , dtype = np .int64 )),
17551765 (ht .UInt64HashTable , np .arange (1000 , dtype = np .uint64 )),
17561766 ],
17571767 )
17581768 def test_hashtable_factorize (self , htable , writable , data ):
17591769 # output of maker has guaranteed unique elements
1760- s = Series (data )
1770+ s = Series (data , dtype = data . dtype )
17611771 if htable == ht .Float64HashTable :
17621772 # add NaN for float column
17631773 s .loc [500 ] = np .nan
0 commit comments