Skip to content

Commit 46e3b9c

Browse files
Terji PetersenTerji Petersen
Terji Petersen
authored and
Terji Petersen
committed
NotImplementedError
1 parent cb69d75 commit 46e3b9c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

pandas/core/indexes/numeric.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def _ensure_array(cls, data, dtype, copy: bool):
178178
subarr = np.asarray(subarr)
179179
if subarr.dtype == "float16":
180180
# float16 not supported (no indexing engine)
181-
raise TypeError("float16 indexes are not supported")
181+
raise NotImplementedError("float16 indexes are not implemented")
182182

183183
return subarr
184184

@@ -211,7 +211,7 @@ def _ensure_dtype(cls, dtype: Dtype | None) -> np.dtype | None:
211211
dtype = np.dtype(np.float32)
212212
if dtype == "float16":
213213
# float16 not supported (no indexing engine)
214-
raise TypeError("float16 indexes are not supported")
214+
raise NotImplementedError("float16 indexes are not supported")
215215

216216
if cls._is_backward_compat_public_numeric_index:
217217
# dtype for NumericIndex

pandas/tests/base/test_conversion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_iterable(self, index_or_series, method, dtype, rdtype):
6363
# coerce iteration to underlying python / pandas types
6464
typ = index_or_series
6565
if dtype == "float16" and issubclass(typ, pd.Index):
66-
with pytest.raises(TypeError, match="float16 indexes are not supported"):
66+
with pytest.raises(NotImplementedError, match="float16 indexes are not "):
6767
typ([1], dtype=dtype)
6868
return
6969
s = typ([1], dtype=dtype)
@@ -120,7 +120,7 @@ def test_iterable_map(self, index_or_series, dtype, rdtype):
120120
# coerce iteration to underlying python / pandas types
121121
typ = index_or_series
122122
if dtype == "float16" and issubclass(typ, pd.Index):
123-
with pytest.raises(TypeError, match="float16 indexes are not supported"):
123+
with pytest.raises(NotImplementedError, match="float16 indexes are not "):
124124
typ([1], dtype=dtype)
125125
return
126126
s = typ([1], dtype=dtype)

pandas/tests/base/test_value_counts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def test_value_counts(index_or_series_obj):
3232
if obj.dtype != np.float16:
3333
expected.index = expected.index.astype(obj.dtype)
3434
else:
35-
with pytest.raises(TypeError, match="float16 indexes are not supported"):
35+
with pytest.raises(NotImplementedError, match="float16 indexes are not "):
3636
expected.index.astype(obj.dtype)
3737
return
3838

@@ -83,7 +83,7 @@ def test_value_counts_null(null_obj, index_or_series_obj):
8383
if obj.dtype != np.float16:
8484
expected.index = expected.index.astype(obj.dtype)
8585
else:
86-
with pytest.raises(TypeError, match="float16 indexes are not supported"):
86+
with pytest.raises(NotImplementedError, match="float16 indexes are not "):
8787
expected.index.astype(obj.dtype)
8888
return
8989

0 commit comments

Comments
 (0)