Skip to content

Commit 6033909

Browse files
REGR: exceptions not caught in _call_map_locations (pandas-dev#34113)
1 parent ef4ab0f commit 6033909

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

doc/source/whatsnew/v1.0.4.rst

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Fixed regressions
2323
- Bug where an ordered :class:`Categorical` containing only ``NaN`` values would raise rather than returning ``NaN`` when taking the minimum or maximum (:issue:`33450`)
2424
- Bug in :meth:`DataFrameGroupBy.agg` with dictionary input losing ``ExtensionArray`` dtypes (:issue:`32194`)
2525
- Fix to preserve the ability to index with the "nearest" method with xarray's CFTimeIndex, an :class:`Index` subclass (`pydata/xarray#3751 <https://github.com/pydata/xarray/issues/3751>`_, :issue:`32905`).
26+
- Fix regression in :meth:`DataFrame.describe` raising ``TypeError: unhashable type: 'dict'`` (:issue:`32409`)
2627
- Bug in :meth:`DataFrame.replace` casts columns to ``object`` dtype if items in ``to_replace`` not in values (:issue:`32988`)
2728
-
2829

pandas/_libs/index.pyx

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ cdef class IndexEngine:
270270

271271
self.need_unique_check = 0
272272

273-
cdef void _call_map_locations(self, values):
273+
cpdef _call_map_locations(self, values):
274274
self.mapping.map_locations(values)
275275

276276
def clear_mapping(self):
@@ -509,7 +509,7 @@ cdef class PeriodEngine(Int64Engine):
509509
cdef _get_index_values(self):
510510
return super(PeriodEngine, self).vgetter()
511511

512-
cdef void _call_map_locations(self, values):
512+
cpdef _call_map_locations(self, values):
513513
# super(...) pattern doesn't seem to work with `cdef`
514514
Int64Engine._call_map_locations(self, values.view('i8'))
515515

pandas/_libs/index_class_helper.pxi.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ cdef class {{name}}Engine(IndexEngine):
3838
raise KeyError(val)
3939
{{endif}}
4040

41-
cdef void _call_map_locations(self, values):
41+
cpdef _call_map_locations(self, values):
4242
# self.mapping is of type {{hashtable_name}}HashTable,
4343
# so convert dtype of values
4444
self.mapping.map_locations(algos.ensure_{{hashtable_dtype}}(values))

0 commit comments

Comments
 (0)