44import numpy as np
55import pytest
66
7- from pandas ._config import using_string_dtype
8-
97from pandas ._libs import (
108 algos as libalgos ,
119 hashtable as ht ,
@@ -1684,7 +1682,6 @@ def test_unique_complex_numbers(self, array, expected):
16841682
16851683
16861684class TestHashTable :
1687- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
16881685 @pytest .mark .parametrize (
16891686 "htable, data" ,
16901687 [
@@ -1697,7 +1694,7 @@ class TestHashTable:
16971694 )
16981695 def test_hashtable_unique (self , htable , data , writable ):
16991696 # output of maker has guaranteed unique elements
1700- s = Series (data )
1697+ s = Series (data , dtype = object if isinstance ( data , list ) else None )
17011698 if htable == ht .Float64HashTable :
17021699 # add NaN for float column
17031700 s .loc [500 ] = np .nan
@@ -1724,7 +1721,6 @@ def test_hashtable_unique(self, htable, data, writable):
17241721 reconstr = result_unique [result_inverse ]
17251722 tm .assert_numpy_array_equal (reconstr , s_duplicated .values )
17261723
1727- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
17281724 @pytest .mark .parametrize (
17291725 "htable, data" ,
17301726 [
@@ -1737,7 +1733,7 @@ def test_hashtable_unique(self, htable, data, writable):
17371733 )
17381734 def test_hashtable_factorize (self , htable , writable , data ):
17391735 # output of maker has guaranteed unique elements
1740- s = Series (data )
1736+ s = Series (data , dtype = object if isinstance ( data , list ) else None )
17411737 if htable == ht .Float64HashTable :
17421738 # add NaN for float column
17431739 s .loc [500 ] = np .nan
0 commit comments