Skip to content

Commit

Permalink
REGR: exceptions not caught in _call_map_locations (#34113)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins authored May 15, 2020
1 parent ef4ab0f commit 6033909
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/source/whatsnew/v1.0.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/pydata/xarray/issues/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`)
-

Expand Down
4 changes: 2 additions & 2 deletions pandas/_libs/index.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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'))

Expand Down
2 changes: 1 addition & 1 deletion pandas/_libs/index_class_helper.pxi.in
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 6033909

Please sign in to comment.