@@ -90,13 +90,13 @@ def hash_pandas_object(
90
90
return Series (hash_tuples (obj , encoding , hash_key ), dtype = "uint64" , copy = False )
91
91
92
92
elif isinstance (obj , ABCIndexClass ):
93
- h = hash_array (obj .values , encoding , hash_key , categorize ).astype (
93
+ h = hash_array (obj ._values , encoding , hash_key , categorize ).astype (
94
94
"uint64" , copy = False
95
95
)
96
96
h = Series (h , index = obj , dtype = "uint64" , copy = False )
97
97
98
98
elif isinstance (obj , ABCSeries ):
99
- h = hash_array (obj .values , encoding , hash_key , categorize ).astype (
99
+ h = hash_array (obj ._values , encoding , hash_key , categorize ).astype (
100
100
"uint64" , copy = False
101
101
)
102
102
if index :
@@ -107,7 +107,7 @@ def hash_pandas_object(
107
107
encoding = encoding ,
108
108
hash_key = hash_key ,
109
109
categorize = categorize ,
110
- ).values
110
+ )._values
111
111
for _ in [None ]
112
112
)
113
113
arrays = itertools .chain ([h ], index_iter )
@@ -116,7 +116,7 @@ def hash_pandas_object(
116
116
h = Series (h , index = obj .index , dtype = "uint64" , copy = False )
117
117
118
118
elif isinstance (obj , ABCDataFrame ):
119
- hashes = (hash_array (series .values ) for _ , series in obj .items ())
119
+ hashes = (hash_array (series ._values ) for _ , series in obj .items ())
120
120
num_items = len (obj .columns )
121
121
if index :
122
122
index_hash_generator = (
@@ -126,7 +126,7 @@ def hash_pandas_object(
126
126
encoding = encoding ,
127
127
hash_key = hash_key ,
128
128
categorize = categorize ,
129
- ).values # noqa
129
+ )._values
130
130
for _ in [None ]
131
131
)
132
132
num_items += 1
@@ -185,28 +185,6 @@ def hash_tuples(vals, encoding="utf8", hash_key: str = _default_hash_key):
185
185
return h
186
186
187
187
188
- def hash_tuple (val , encoding : str = "utf8" , hash_key : str = _default_hash_key ):
189
- """
190
- Hash a single tuple efficiently
191
-
192
- Parameters
193
- ----------
194
- val : single tuple
195
- encoding : str, default 'utf8'
196
- hash_key : str, default _default_hash_key
197
-
198
- Returns
199
- -------
200
- hash
201
-
202
- """
203
- hashes = (_hash_scalar (v , encoding = encoding , hash_key = hash_key ) for v in val )
204
-
205
- h = _combine_hash_arrays (hashes , len (val ))[0 ]
206
-
207
- return h
208
-
209
-
210
188
def _hash_categorical (c , encoding : str , hash_key : str ):
211
189
"""
212
190
Hash a Categorical by hashing its categories, and then mapping the codes
@@ -223,7 +201,7 @@ def _hash_categorical(c, encoding: str, hash_key: str):
223
201
ndarray of hashed values array, same size as len(c)
224
202
"""
225
203
# Convert ExtensionArrays to ndarrays
226
- values = np .asarray (c .categories .values )
204
+ values = np .asarray (c .categories ._values )
227
205
hashed = hash_array (values , encoding , hash_key , categorize = False )
228
206
229
207
# we have uint64, as we don't directly support missing values
0 commit comments