File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1117,8 +1117,14 @@ def take(
1117
1117
if is_scalar (indices ):
1118
1118
raise TypeError ("Expected indices to be array-like" )
1119
1119
indices = ensure_platform_int (indices )
1120
- allow_fill = self ._maybe_disallow_fill (allow_fill , fill_value , indices )
1121
- assert allow_fill is False , "allow_fill isn't supported by RangeIndex"
1120
+
1121
+ # If allow_fill=True and fill_value=None, just ignore allow_fill,
1122
+ # without raising an exception, as it's done in the base class.
1123
+ if allow_fill and fill_value is not None :
1124
+ cls_name = type (self ).__name__
1125
+ raise ValueError (
1126
+ f"Unable to fill values because { cls_name } cannot contain NA"
1127
+ )
1122
1128
1123
1129
if len (indices ) == 0 :
1124
1130
taken = np .array ([], dtype = self .dtype )
You can’t perform that action at this time.
0 commit comments