File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 9
9
import numpy as np
10
10
import pytest
11
11
12
+ from pandas ._config import using_string_dtype
13
+
12
14
from pandas .compat .numpy import np_version_gte1p25
13
15
14
16
import pandas as pd
@@ -2668,10 +2670,10 @@ def test_pivot_columns_not_given(self):
2668
2670
2669
2671
# this still fails because columns=None gets passed down to unstack as level=None
2670
2672
# while at that point None was converted to NaN
2671
- # @pytest.mark.xfail(
2672
- # using_string_dtype(), reason="TODO(infer_string) None is cast to NaN"
2673
- # )
2674
- def test_pivot_columns_is_none (self , using_infer_string ):
2673
+ @pytest .mark .xfail (
2674
+ using_string_dtype (), reason = "TODO(infer_string) None is cast to NaN"
2675
+ )
2676
+ def test_pivot_columns_is_none (self ):
2675
2677
# GH#48293
2676
2678
df = DataFrame ({None : [1 ], "b" : 2 , "c" : 3 })
2677
2679
result = df .pivot (columns = None )
@@ -2684,8 +2686,6 @@ def test_pivot_columns_is_none(self, using_infer_string):
2684
2686
2685
2687
result = df .pivot (columns = None , index = "b" , values = "c" )
2686
2688
expected = DataFrame ({1 : 3 }, index = Index ([2 ], name = "b" ))
2687
- if using_infer_string :
2688
- expected .columns .name = np .nan
2689
2689
tm .assert_frame_equal (result , expected )
2690
2690
2691
2691
def test_pivot_index_is_none (self , using_infer_string ):
You can’t perform that action at this time.
0 commit comments