@@ -63,6 +63,7 @@ def test_hash_pandas_object(self):
63
63
Series ([1.0 , 1.5 , 3.2 ], index = [1.5 , 1.1 , 3.3 ]),
64
64
Series (['a' , 'b' , 'c' ]),
65
65
Series (['a' , np .nan , 'c' ]),
66
+ Series (['a' , None , 'c' ]),
66
67
Series ([True , False , True ]),
67
68
Index ([1 , 2 , 3 ]),
68
69
Index ([True , False , True ]),
@@ -71,9 +72,7 @@ def test_hash_pandas_object(self):
71
72
tm .makeMixedDataFrame (),
72
73
tm .makeTimeDataFrame (),
73
74
tm .makeTimeSeries (),
74
- tm .makeTimedeltaIndex (),
75
- Series ([1 , 2 , 3 ], index = pd .MultiIndex .from_tuples (
76
- [('a' , 1 ), ('a' , 2 ), ('b' , 1 )]))]:
75
+ tm .makeTimedeltaIndex ()]:
77
76
self .check_equal (obj )
78
77
self .check_not_equal_with_index (obj )
79
78
@@ -115,16 +114,22 @@ def f():
115
114
hash_pandas_object (Series (list ('abc' )), hash_key = 'foo' )
116
115
self .assertRaises (ValueError , f )
117
116
118
- def test_mixed (self ):
119
- # mixed objects
117
+ def test_unsupported_objects (self ):
118
+
119
+ # mixed objects are not supported
120
120
obj = Series (['1' , 2 , 3 ])
121
- self .check_equal (obj )
122
- self .check_not_equal_with_index (obj )
123
121
124
- # mixed are actually equal when stringified
125
- a = hash_pandas_object (obj )
126
- b = hash_pandas_object (Series (list ('123' )))
127
- self .assert_series_equal (a , b )
122
+ def f ():
123
+ hash_pandas_object (obj )
124
+ self .assertRaises (TypeError , f )
125
+
126
+ # MultiIndex are represented as tuples
127
+ obj = Series ([1 , 2 , 3 ], index = pd .MultiIndex .from_tuples (
128
+ [('a' , 1 ), ('a' , 2 ), ('b' , 1 )]))
129
+
130
+ def f ():
131
+ hash_pandas_object (obj )
132
+ self .assertRaises (TypeError , f )
128
133
129
134
def test_alread_encoded (self ):
130
135
# if already encoded then ok
0 commit comments