Skip to content

Commit 88b6370

Browse files
Terji PetersenTerji Petersen
Terji Petersen
authored and
Terji Petersen
committed
NotImplementedError
1 parent ac544e9 commit 88b6370

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
@@ -179,7 +179,7 @@ def _ensure_array(cls, data, dtype, copy: bool):
179179
subarr = np.asarray(subarr)
180180
if subarr.dtype == "float16":
181181
# float16 not supported (no indexing engine)
182-
raise TypeError("float16 indexes are not supported")
182+
raise NotImplementedError("float16 indexes are not implemented")
183183

184184
return subarr
185185

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

217217
if cls._is_backward_compat_public_numeric_index:
218218
# 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)