File tree 3 files changed +9
-6
lines changed
3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -70,11 +70,7 @@ Bug Fixes
70
70
71
71
- Bug in ``transform`` causing length mismatch when null entries were present and a fast aggregator was being used (:issue:`9697`)
72
72
73
-
74
-
75
-
76
-
77
-
73
+ - Bug : Trying to access absent attributes in TimedeltaIndex use to raise ValueError instead of AttributeError(:issue:`9680`)
78
74
79
75
80
76
- Bug in ``Series.quantile`` on empty Series of type ``Datetime`` or ``Timedelta`` (:issue:`9675`)
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ def __contains__(self, key):
67
67
try :
68
68
res = self .get_loc (key )
69
69
return np .isscalar (res ) or type (res ) == slice or np .any (res )
70
- except (KeyError , TypeError ):
70
+ except (KeyError , TypeError , ValueError ):
71
71
return False
72
72
73
73
@property
Original file line number Diff line number Diff line change @@ -745,6 +745,13 @@ def test_nonunique_contains(self):
745
745
['00:01:00' , '00:01:00' , '00:00:01' ])):
746
746
tm .assertIn (idx [0 ], idx )
747
747
748
+ def test_unknown_attribute (self ):
749
+ #GH 9680
750
+ tdi = pd .timedelta_range (start = 0 ,periods = 10 ,freq = '1s' )
751
+ ts = pd .Series (np .random .normal (size = 10 ),index = tdi )
752
+ self .assertNotIn ('foo' ,ts .__dict__ .keys ())
753
+ self .assertRaises (AttributeError ,lambda : ts .foo )
754
+
748
755
749
756
class TestPeriodIndexOps (Ops ):
750
757
You can’t perform that action at this time.
0 commit comments