3
3
import numpy as np
4
4
import pytest
5
5
6
+ from pandas ._config import using_string_dtype
7
+
6
8
from pandas .core .dtypes .base import _registry as ea_registry
7
9
from pandas .core .dtypes .common import is_object_dtype
8
10
from pandas .core .dtypes .dtypes import (
@@ -144,6 +146,7 @@ def test_setitem_different_dtype(self):
144
146
)
145
147
tm .assert_series_equal (result , expected )
146
148
149
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
147
150
def test_setitem_empty_columns (self ):
148
151
# GH 13522
149
152
df = DataFrame (index = ["A" , "B" , "C" ])
@@ -159,6 +162,7 @@ def test_setitem_dt64_index_empty_columns(self):
159
162
df ["A" ] = rng
160
163
assert df ["A" ].dtype == np .dtype ("M8[ns]" )
161
164
165
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
162
166
def test_setitem_timestamp_empty_columns (self ):
163
167
# GH#19843
164
168
df = DataFrame (index = range (3 ))
@@ -198,6 +202,7 @@ def test_setitem_with_unaligned_sparse_value(self):
198
202
expected = Series (SparseArray ([1 , 0 , 0 ]), name = "new_column" )
199
203
tm .assert_series_equal (df ["new_column" ], expected )
200
204
205
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
201
206
def test_setitem_period_preserves_dtype (self ):
202
207
# GH: 26861
203
208
data = [Period ("2003-12" , "D" )]
@@ -667,6 +672,7 @@ def test_setitem_iloc_two_dimensional_generator(self):
667
672
expected = DataFrame ({"a" : [1 , 2 , 3 ], "b" : [4 , 1 , 1 ]})
668
673
tm .assert_frame_equal (df , expected )
669
674
675
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
670
676
def test_setitem_dtypes_bytes_type_to_object (self ):
671
677
# GH 20734
672
678
index = Series (name = "id" , dtype = "S24" )
@@ -699,6 +705,7 @@ def test_setitem_ea_dtype_rhs_series(self):
699
705
expected = DataFrame ({"a" : [1 , 2 ]}, dtype = "Int64" )
700
706
tm .assert_frame_equal (df , expected )
701
707
708
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
702
709
def test_setitem_npmatrix_2d (self ):
703
710
# GH#42376
704
711
# for use-case df["x"] = sparse.random((10, 10)).mean(axis=1)
@@ -920,6 +927,7 @@ def test_setitem_with_expansion_categorical_dtype(self):
920
927
ser .name = "E"
921
928
tm .assert_series_equal (result2 .sort_index (), ser .sort_index ())
922
929
930
+ @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
923
931
def test_setitem_scalars_no_index (self ):
924
932
# GH#16823 / GH#17894
925
933
df = DataFrame ()
0 commit comments