4
4
import numpy as np
5
5
import pytest
6
6
7
- from pandas ._config import using_string_dtype
8
-
9
7
from pandas ._libs import (
10
8
algos as libalgos ,
11
9
hashtable as ht ,
@@ -1684,7 +1682,6 @@ def test_unique_complex_numbers(self, array, expected):
1684
1682
1685
1683
1686
1684
class TestHashTable :
1687
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
1688
1685
@pytest .mark .parametrize (
1689
1686
"htable, data" ,
1690
1687
[
@@ -1697,7 +1694,7 @@ class TestHashTable:
1697
1694
)
1698
1695
def test_hashtable_unique (self , htable , data , writable ):
1699
1696
# output of maker has guaranteed unique elements
1700
- s = Series (data )
1697
+ s = Series (data , dtype = object if isinstance ( data , list ) else None )
1701
1698
if htable == ht .Float64HashTable :
1702
1699
# add NaN for float column
1703
1700
s .loc [500 ] = np .nan
@@ -1724,7 +1721,6 @@ def test_hashtable_unique(self, htable, data, writable):
1724
1721
reconstr = result_unique [result_inverse ]
1725
1722
tm .assert_numpy_array_equal (reconstr , s_duplicated .values )
1726
1723
1727
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" , strict = False )
1728
1724
@pytest .mark .parametrize (
1729
1725
"htable, data" ,
1730
1726
[
@@ -1737,7 +1733,7 @@ def test_hashtable_unique(self, htable, data, writable):
1737
1733
)
1738
1734
def test_hashtable_factorize (self , htable , writable , data ):
1739
1735
# output of maker has guaranteed unique elements
1740
- s = Series (data )
1736
+ s = Series (data , dtype = object if isinstance ( data , list ) else None )
1741
1737
if htable == ht .Float64HashTable :
1742
1738
# add NaN for float column
1743
1739
s .loc [500 ] = np .nan
0 commit comments