6
6
import numpy as np
7
7
import pytest
8
8
9
- from pandas ._config import using_string_dtype
10
-
11
9
from pandas ._libs .tslibs import iNaT
12
10
from pandas .compat import (
13
11
is_ci_environment ,
@@ -401,7 +399,6 @@ def test_interchange_from_corrected_buffer_dtypes(monkeypatch) -> None:
401
399
pd .api .interchange .from_dataframe (df )
402
400
403
401
404
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
405
402
def test_empty_string_column ():
406
403
# https://github.com/pandas-dev/pandas/issues/56703
407
404
df = pd .DataFrame ({"a" : []}, dtype = str )
@@ -410,13 +407,12 @@ def test_empty_string_column():
410
407
tm .assert_frame_equal (df , result )
411
408
412
409
413
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
414
410
def test_large_string ():
415
411
# GH#56702
416
412
pytest .importorskip ("pyarrow" )
417
413
df = pd .DataFrame ({"a" : ["x" ]}, dtype = "large_string[pyarrow]" )
418
414
result = pd .api .interchange .from_dataframe (df .__dataframe__ ())
419
- expected = pd .DataFrame ({"a" : ["x" ]}, dtype = "object " )
415
+ expected = pd .DataFrame ({"a" : ["x" ]}, dtype = "str " )
420
416
tm .assert_frame_equal (result , expected )
421
417
422
418
@@ -427,7 +423,6 @@ def test_non_str_names():
427
423
assert names == ["0" ]
428
424
429
425
430
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
431
426
def test_non_str_names_w_duplicates ():
432
427
# https://github.com/pandas-dev/pandas/issues/56701
433
428
df = pd .DataFrame ({"0" : [1 , 2 , 3 ], 0 : [4 , 5 , 6 ]})
@@ -438,7 +433,7 @@ def test_non_str_names_w_duplicates():
438
433
"Expected a Series, got a DataFrame. This likely happened because you "
439
434
"called __dataframe__ on a DataFrame which, after converting column "
440
435
r"names to string, resulted in duplicated names: Index\(\['0', '0'\], "
441
- r"dtype='object'\). Please rename these columns before using the "
436
+ r"dtype='(str| object) '\). Please rename these columns before using the "
442
437
"interchange protocol."
443
438
),
444
439
):
0 commit comments