@@ -635,7 +635,7 @@ def test_pie_series(self):
635635 series = Series ([1 , 2 , np .nan , 4 ],
636636 index = ['a' , 'b' , 'c' , 'd' ], name = 'YLABEL' )
637637 ax = _check_plot_works (series .plot , kind = 'pie' )
638- self ._check_text_labels (ax .texts , series . index )
638+ self ._check_text_labels (ax .texts , [ 'a' , 'b' , '' , 'd' ] )
639639
640640 def test_pie_nan (self ):
641641 s = Series ([1 , np .nan , 1 , 1 ])
@@ -2798,13 +2798,17 @@ def test_pie_df_nan(self):
27982798
27992799 base_expected = ['0' , '1' , '2' , '3' ]
28002800 for i , ax in enumerate (axes ):
2801- expected = list (base_expected ) # copy
2801+ expected = list (base_expected ) # force copy
28022802 expected [i ] = ''
28032803 result = [x .get_text () for x in ax .texts ]
28042804 self .assertEqual (result , expected )
28052805 # legend labels
2806- self .assertEqual ([x .get_text () for x in ax .get_legend ().get_texts ()],
2807- base_expected )
2806+ # NaN's not included in legend with subplots
2807+ # see https://github.com/pydata/pandas/issues/8390
2808+ self .assertEqual ([x .get_text () for x in
2809+ ax .get_legend ().get_texts ()],
2810+ base_expected [:i ] + base_expected [i + 1 :])
2811+
28082812 def test_errorbar_plot (self ):
28092813 d = {'x' : np .arange (12 ), 'y' : np .arange (12 , 0 , - 1 )}
28102814 df = DataFrame (d )
0 commit comments