12
12
is_float_dtype , is_datetime64_dtype ,
13
13
is_datetime64tz_dtype , is_integer_dtype ,
14
14
_ensure_float64 , is_scalar ,
15
- needs_i8_conversion , is_integer ,
16
- is_period_arraylike )
15
+ needs_i8_conversion , is_integer )
17
16
from pandas .types .missing import isnull , is_valid_fill_value
18
17
from pandas .types .generic import ABCSeries
19
18
@@ -625,7 +624,7 @@ def fill_zeros(result, x, y, name, fill):
625
624
return result
626
625
627
626
628
- def maybe_fill (obj , value , errors ):
627
+ def validate_fill_value (obj , value ):
629
628
"""
630
629
631
630
Fillna error coercion routine.
@@ -659,16 +658,8 @@ def maybe_fill(obj, value, errors):
659
658
fillna error coercion routine, returns whether or not to continue.
660
659
"""
661
660
if isinstance (obj , ABCSeries ):
662
- if errors is None or errors == 'coerce' :
663
- return True
664
- else :
665
- if not is_valid_fill_value (value , obj .dtype ):
666
- if errors == 'raise' :
667
- raise TypeError ('"value" parameter must be compatible '
668
- 'with the {0} dtype, but you passed a '
669
- '"{1}"' .format (obj .dtype ,
670
- type (value ).__name__ ))
671
- else : # errors == 'ignore'; short-circuit
672
- return False
673
- else :
674
- return True
661
+ if not is_valid_fill_value (value , obj .dtype ):
662
+ raise TypeError ('"value" parameter must be compatible '
663
+ 'with the {0} dtype, but you passed a '
664
+ '"{1}"' .format (obj .dtype ,
665
+ type (value ).__name__ ))
0 commit comments