File tree 3 files changed +5
-25
lines changed
3 files changed +5
-25
lines changed Original file line number Diff line number Diff line change @@ -170,10 +170,6 @@ cdef class Reducer:
170
170
PyArray_SETITEM(result, PyArray_ITER_DATA(it), res)
171
171
chunk.data = chunk.data + self .increment
172
172
PyArray_ITER_NEXT(it)
173
- except Exception as err:
174
- if hasattr (err, ' args' ):
175
- err.args = err.args + (i,)
176
- raise
177
173
finally :
178
174
# so we don't free the wrong memory
179
175
chunk.data = dummy_buf
Original file line number Diff line number Diff line change 13
13
)
14
14
from pandas .core .dtypes .generic import ABCSeries
15
15
16
- from pandas .io .formats .printing import pprint_thing
17
-
18
16
19
17
def frame_apply (
20
18
obj ,
@@ -293,20 +291,9 @@ def apply_series_generator(self):
293
291
res_index = res_index .take (successes )
294
292
295
293
else :
296
- try :
297
- for i , v in enumerate (series_gen ):
298
- results [i ] = self .f (v )
299
- keys .append (v .name )
300
- except Exception as err :
301
- if hasattr (err , "args" ):
302
-
303
- # make sure i is defined
304
- if i is not None :
305
- k = res_index [i ]
306
- err .args = err .args + (
307
- "occurred at index %s" % pprint_thing (k ),
308
- )
309
- raise
294
+ for i , v in enumerate (series_gen ):
295
+ results [i ] = self .f (v )
296
+ keys .append (v .name )
310
297
311
298
self .results = results
312
299
self .res_index = res_index
Original file line number Diff line number Diff line change @@ -423,12 +423,9 @@ def transform2(row):
423
423
row ["D" ] = 7
424
424
return row
425
425
426
- try :
426
+ msg = "'float' object has no attribute 'startswith'"
427
+ with pytest .raises (AttributeError , match = msg ):
427
428
data .apply (transform , axis = 1 )
428
- except AttributeError as e :
429
- assert len (e .args ) == 2
430
- assert e .args [1 ] == "occurred at index 4"
431
- assert e .args [0 ] == "'float' object has no attribute 'startswith'"
432
429
433
430
def test_apply_bug (self ):
434
431
You can’t perform that action at this time.
0 commit comments