From 6033909ad00ec0fdcab986da9dde01e5cfde1c8a Mon Sep 17 00:00:00 2001 From: Simon Hawkins Date: Fri, 15 May 2020 10:33:12 +0100 Subject: [PATCH] REGR: exceptions not caught in _call_map_locations (#34113) --- doc/source/whatsnew/v1.0.4.rst | 1 + pandas/_libs/index.pyx | 4 ++-- pandas/_libs/index_class_helper.pxi.in | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/source/whatsnew/v1.0.4.rst b/doc/source/whatsnew/v1.0.4.rst index 2d73cbd72c67a..88b4ba748fd63 100644 --- a/doc/source/whatsnew/v1.0.4.rst +++ b/doc/source/whatsnew/v1.0.4.rst @@ -23,6 +23,7 @@ Fixed regressions - Bug where an ordered :class:`Categorical` containing only ``NaN`` values would raise rather than returning ``NaN`` when taking the minimum or maximum (:issue:`33450`) - Bug in :meth:`DataFrameGroupBy.agg` with dictionary input losing ``ExtensionArray`` dtypes (:issue:`32194`) - Fix to preserve the ability to index with the "nearest" method with xarray's CFTimeIndex, an :class:`Index` subclass (`pydata/xarray#3751 `_, :issue:`32905`). +- Fix regression in :meth:`DataFrame.describe` raising ``TypeError: unhashable type: 'dict'`` (:issue:`32409`) - Bug in :meth:`DataFrame.replace` casts columns to ``object`` dtype if items in ``to_replace`` not in values (:issue:`32988`) - diff --git a/pandas/_libs/index.pyx b/pandas/_libs/index.pyx index ac8172146d351..03ce668e1fc5c 100644 --- a/pandas/_libs/index.pyx +++ b/pandas/_libs/index.pyx @@ -270,7 +270,7 @@ cdef class IndexEngine: self.need_unique_check = 0 - cdef void _call_map_locations(self, values): + cpdef _call_map_locations(self, values): self.mapping.map_locations(values) def clear_mapping(self): @@ -509,7 +509,7 @@ cdef class PeriodEngine(Int64Engine): cdef _get_index_values(self): return super(PeriodEngine, self).vgetter() - cdef void _call_map_locations(self, values): + cpdef _call_map_locations(self, values): # super(...) pattern doesn't seem to work with `cdef` Int64Engine._call_map_locations(self, values.view('i8')) diff --git a/pandas/_libs/index_class_helper.pxi.in b/pandas/_libs/index_class_helper.pxi.in index 093cca4fe7ed5..69b7db935d4f2 100644 --- a/pandas/_libs/index_class_helper.pxi.in +++ b/pandas/_libs/index_class_helper.pxi.in @@ -38,7 +38,7 @@ cdef class {{name}}Engine(IndexEngine): raise KeyError(val) {{endif}} - cdef void _call_map_locations(self, values): + cpdef _call_map_locations(self, values): # self.mapping is of type {{hashtable_name}}HashTable, # so convert dtype of values self.mapping.map_locations(algos.ensure_{{hashtable_dtype}}(values))