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 ,
@@ -412,7 +410,6 @@ def test_interchange_from_corrected_buffer_dtypes(monkeypatch) -> None:
412
410
pd .api .interchange .from_dataframe (df )
413
411
414
412
415
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
416
413
def test_empty_string_column ():
417
414
# https://github.com/pandas-dev/pandas/issues/56703
418
415
df = pd .DataFrame ({"a" : []}, dtype = str )
@@ -421,13 +418,12 @@ def test_empty_string_column():
421
418
tm .assert_frame_equal (df , result )
422
419
423
420
424
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
425
421
def test_large_string ():
426
422
# GH#56702
427
423
pytest .importorskip ("pyarrow" )
428
424
df = pd .DataFrame ({"a" : ["x" ]}, dtype = "large_string[pyarrow]" )
429
425
result = pd .api .interchange .from_dataframe (df .__dataframe__ ())
430
- expected = pd .DataFrame ({"a" : ["x" ]}, dtype = "object " )
426
+ expected = pd .DataFrame ({"a" : ["x" ]}, dtype = "str " )
431
427
tm .assert_frame_equal (result , expected )
432
428
433
429
@@ -438,7 +434,6 @@ def test_non_str_names():
438
434
assert names == ["0" ]
439
435
440
436
441
- @pytest .mark .xfail (using_string_dtype (), reason = "TODO(infer_string)" )
442
437
def test_non_str_names_w_duplicates ():
443
438
# https://github.com/pandas-dev/pandas/issues/56701
444
439
df = pd .DataFrame ({"0" : [1 , 2 , 3 ], 0 : [4 , 5 , 6 ]})
@@ -449,7 +444,7 @@ def test_non_str_names_w_duplicates():
449
444
"Expected a Series, got a DataFrame. This likely happened because you "
450
445
"called __dataframe__ on a DataFrame which, after converting column "
451
446
r"names to string, resulted in duplicated names: Index\(\['0', '0'\], "
452
- r"dtype='object'\). Please rename these columns before using the "
447
+ r"dtype='(str| object) '\). Please rename these columns before using the "
453
448
"interchange protocol."
454
449
),
455
450
):
0 commit comments