From 3c7e12533f3bacb758f8d76f185588c525eec9fa Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 28 Oct 2024 19:17:02 +0100 Subject: [PATCH] TST (string dtype): fix xfails in test_algos.py --- pandas/tests/test_algos.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pandas/tests/test_algos.py b/pandas/tests/test_algos.py index dac74a0e32a42..42aab930527c4 100644 --- a/pandas/tests/test_algos.py +++ b/pandas/tests/test_algos.py @@ -4,8 +4,6 @@ import numpy as np import pytest -from pandas._config import using_string_dtype - from pandas._libs import ( algos as libalgos, hashtable as ht, @@ -1684,7 +1682,6 @@ def test_unique_complex_numbers(self, array, expected): class TestHashTable: - @pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False) @pytest.mark.parametrize( "htable, data", [ @@ -1697,7 +1694,7 @@ class TestHashTable: ) def test_hashtable_unique(self, htable, data, writable): # output of maker has guaranteed unique elements - s = Series(data) + s = Series(data, dtype=object if isinstance(data, list) else None) if htable == ht.Float64HashTable: # add NaN for float column s.loc[500] = np.nan @@ -1724,7 +1721,6 @@ def test_hashtable_unique(self, htable, data, writable): reconstr = result_unique[result_inverse] tm.assert_numpy_array_equal(reconstr, s_duplicated.values) - @pytest.mark.xfail(using_string_dtype(), reason="TODO(infer_string)", strict=False) @pytest.mark.parametrize( "htable, data", [ @@ -1737,7 +1733,7 @@ def test_hashtable_unique(self, htable, data, writable): ) def test_hashtable_factorize(self, htable, writable, data): # output of maker has guaranteed unique elements - s = Series(data) + s = Series(data, dtype=object if isinstance(data, list) else None) if htable == ht.Float64HashTable: # add NaN for float column s.loc[500] = np.nan