-
Notifications
You must be signed in to change notification settings - Fork 147
/
test_hash.py
589 lines (458 loc) · 19.2 KB
/
test_hash.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
from __future__ import annotations
import decimal
from datetime import date, datetime, time
import numpy as np
import pytest
import pytz
import xxhash
from daft.datatype import DataType
from daft.series import Series
from tests.test_datatypes import daft_numeric_types
@pytest.mark.parametrize(
"nbytes, dtype",
[
(1, DataType.uint8()),
(1, DataType.int8()),
(2, DataType.uint16()),
(2, DataType.int16()),
(4, DataType.uint32()),
(4, DataType.int32()),
(8, DataType.uint64()),
(8, DataType.int64()),
],
)
def test_hash_int_array_with_reference(nbytes, dtype):
arr = Series.from_numpy(np.random.randint(0, 127, 100)).cast(dtype)
hashed = arr.hash()
for v, hv in zip(arr.to_pylist(), hashed.to_pylist()):
vbytes = v.to_bytes(nbytes, "little")
ref_value = xxhash.xxh3_64_intdigest(vbytes)
assert hv == ref_value
hashed_again = arr.hash(hashed)
for v, hashed_value, hashed_again_value in zip(arr.to_pylist(), hashed.to_pylist(), hashed_again.to_pylist()):
vbytes = v.to_bytes(nbytes, "little")
ref_value = xxhash.xxh3_64_intdigest(vbytes, seed=hashed_value)
assert hashed_again_value == ref_value
def test_hash_bool_array_with_reference():
arr = Series.from_pylist([False, True, True])
expected = [xxhash.xxh3_64_intdigest(b"0"), xxhash.xxh3_64_intdigest(b"1"), xxhash.xxh3_64_intdigest(b"1")]
hashed = arr.hash()
assert hashed.to_pylist() == expected
hashed_again = arr.hash(hashed)
expected = [
xxhash.xxh3_64_intdigest(b"0", expected[0]),
xxhash.xxh3_64_intdigest(b"1", expected[1]),
xxhash.xxh3_64_intdigest(b"1", expected[2]),
]
assert hashed_again.to_pylist() == expected
def test_hash_str_array_with_reference():
arr = Series.from_pylist(["hi", "bye", None])
expected = [xxhash.xxh3_64_intdigest(b"hi"), xxhash.xxh3_64_intdigest(b"bye"), xxhash.xxh3_64_intdigest(b"")]
hashed = arr.hash()
assert hashed.to_pylist() == expected
hashed_again = arr.hash(hashed)
expected = [
xxhash.xxh3_64_intdigest(b"hi", expected[0]),
xxhash.xxh3_64_intdigest(b"bye", expected[1]),
xxhash.xxh3_64_intdigest(b"", expected[2]),
]
assert hashed_again.to_pylist() == expected
def test_hash_binary_array_with_reference():
arr = Series.from_pylist([b"hi", b"bye", None])
expected = [xxhash.xxh3_64_intdigest(b"hi"), xxhash.xxh3_64_intdigest(b"bye"), xxhash.xxh3_64_intdigest(b"")]
hashed = arr.hash()
assert hashed.to_pylist() == expected
hashed_again = arr.hash(hashed)
expected = [
xxhash.xxh3_64_intdigest(b"hi", expected[0]),
xxhash.xxh3_64_intdigest(b"bye", expected[1]),
xxhash.xxh3_64_intdigest(b"", expected[2]),
]
assert hashed_again.to_pylist() == expected
def test_hash_fixed_size_binary_array_with_reference():
import pyarrow as pa
arr = Series.from_arrow(pa.array([b"foo", b"bar", None], type=pa.binary(3)))
expected = [
xxhash.xxh3_64_intdigest(b"foo"),
xxhash.xxh3_64_intdigest(b"bar"),
xxhash.xxh3_64_intdigest(b"\x00\x00\x00"),
]
hashed = arr.hash()
assert hashed.to_pylist() == expected
hashed_again = arr.hash(hashed)
expected = [
xxhash.xxh3_64_intdigest(b"foo", expected[0]),
xxhash.xxh3_64_intdigest(b"bar", expected[1]),
xxhash.xxh3_64_intdigest(b"\x00\x00\x00", expected[2]),
]
assert hashed_again.to_pylist() == expected
def test_hash_null_array_with_reference():
arr = Series.from_pylist([None, None, None])
expected = [xxhash.xxh3_64_intdigest(b""), xxhash.xxh3_64_intdigest(b""), xxhash.xxh3_64_intdigest(b"")]
hashed = arr.hash()
assert hashed.to_pylist() == expected
hashed_again = arr.hash(hashed)
expected = [
xxhash.xxh3_64_intdigest(b"", expected[0]),
xxhash.xxh3_64_intdigest(b"", expected[1]),
xxhash.xxh3_64_intdigest(b"", expected[2]),
]
assert hashed_again.to_pylist() == expected
def test_hash_int_array_with_bad_seed():
arr = Series.from_numpy(np.random.randint(0, 127, 100)).cast(DataType.uint64())
bad_seed = Series.from_numpy(np.random.randint(0, 127, 100)).cast(DataType.float64())
with pytest.raises(ValueError, match="We can only use UInt64 as a seed"):
arr.hash(bad_seed)
def test_hash_int_array_with_bad_length():
arr = Series.from_numpy(np.random.randint(0, 127, 100)).cast(DataType.uint64())
bad_seed = Series.from_numpy(np.random.randint(0, 127, 99)).cast(DataType.uint64())
with pytest.raises(ValueError, match="seed length does not match array length"):
arr.hash(bad_seed)
@pytest.mark.parametrize("dtype", daft_numeric_types)
def test_hash_list_array_no_seed(dtype):
arr = Series.from_pylist([[1, 2], [1, 3], [1, 2], [1, 2, 3], [], [], [2, 1]]).cast(DataType.list(dtype))
hashed = arr.hash().to_pylist()
assert hashed[0] == hashed[2]
assert hashed[4] == hashed[5]
different_inds = [0, 1, 3, 4, 6]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
@pytest.mark.parametrize("seed", [1, 2, 42])
def test_hash_list_array_seeded(dtype, seed):
arr = Series.from_pylist([[1, 2], [1, 3], [1, 2], [1, 2, 3], [], [], [2, 1]]).cast(DataType.list(dtype))
seeds = Series.from_pylist([seed] * 9).cast(DataType.uint64())
hashed = arr.hash(seeds).to_pylist()
assert hashed[0] == hashed[2]
assert hashed[4] == hashed[5]
different_inds = [0, 1, 3, 4, 6]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
def test_hash_list_array_no_seed_with_invalid(dtype):
arr = Series.from_pylist([[1, 2], [1, 3], [1, 2], [1, 2, 3], [], [], None, [2, 1], None]).cast(DataType.list(dtype))
hashed = arr.hash().to_pylist()
assert hashed[0] == hashed[2]
assert hashed[4] == hashed[5]
assert hashed[6] is None
assert hashed[8] is None
different_inds = [0, 1, 3, 4, 7]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
@pytest.mark.parametrize("seed", [1, 2, 42])
def test_hash_list_array_seeded_with_invalid(dtype, seed):
arr = Series.from_pylist([[1, 2], [1, 3], [1, 2], [1, 2, 3], [], [], None, [2, 1], None]).cast(DataType.list(dtype))
seeds = Series.from_pylist([seed] * 9).cast(DataType.uint64())
hashed = arr.hash(seeds).to_pylist()
assert hashed[0] == hashed[2]
assert hashed[4] == hashed[5]
assert hashed[6] is None
assert hashed[8] is None
different_inds = [0, 1, 3, 4, 7]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
def test_hash_list_array_different_seeds(dtype):
arr = Series.from_pylist([[1, 2], [1, 2], [1, 2], [1, 2]]).cast(DataType.list(dtype))
seeds = Series.from_pylist([1, 2, 3, 4]).cast(DataType.uint64())
hashed = arr.hash(seeds).to_pylist()
different_inds = [0, 1, 2, 3]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
def test_hash_list_array_nested_lists(dtype):
arr = Series.from_pylist(
[
[[1, 2], [3, 4]],
[[1, 2], [3, 5]],
[[1, 2], [3, 4]],
[[3, 4], [1, 2]],
[[1], [2]],
[[], []],
[[]],
[],
[[1, 2, 3]],
[[1], [2], [3]],
]
).cast(DataType.list(DataType.list(dtype)))
hashed = arr.hash().to_pylist()
assert hashed[0] == hashed[2]
different_inds = [0, 1, 3, 4, 5, 6, 7, 8, 9]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
def test_hash_list_array_consistency(dtype):
data = [[1, 2], [1, 3], [1, 2], [1, 2, 3], [], [], None, [2, 1], None]
arr1 = Series.from_pylist(data).cast(DataType.list(dtype))
arr2 = Series.from_pylist(data).cast(DataType.list(dtype))
hashed1 = arr1.hash().to_pylist()
hashed2 = arr2.hash().to_pylist()
assert hashed1 == hashed2
@pytest.mark.parametrize("dtype", daft_numeric_types)
def test_hash_fixed_size_list_array_no_seed(dtype):
arr = Series.from_pylist([[1, 2], [1, 3], [1, 2], [1, 4], [5, 5], [5, 5], [2, 1]]).cast(
DataType.fixed_size_list(dtype, 2)
)
hashed = arr.hash().to_pylist()
assert hashed[0] == hashed[2]
assert hashed[4] == hashed[5]
different_inds = [0, 1, 3, 4, 6]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
@pytest.mark.parametrize("seed", [1, 2, 42])
def test_hash_fixed_size_list_array_seeded(dtype, seed):
arr = Series.from_pylist([[1, 2], [1, 3], [1, 2], [1, 4], [5, 5], [5, 5], [2, 1]]).cast(
DataType.fixed_size_list(dtype, 2)
)
seeds = Series.from_pylist([seed] * 9).cast(DataType.uint64())
hashed = arr.hash(seeds).to_pylist()
assert hashed[0] == hashed[2]
assert hashed[4] == hashed[5]
different_inds = [0, 1, 3, 4, 6]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
def test_hash_fixed_size_list_array_no_seed_with_invalid(dtype):
arr = Series.from_pylist([[1, 2], [1, 3], [1, 2], [1, 4], [5, 5], [5, 5], None, [2, 1], None]).cast(
DataType.fixed_size_list(dtype, 2)
)
hashed = arr.hash().to_pylist()
assert hashed[0] == hashed[2]
assert hashed[4] == hashed[5]
assert hashed[6] is None
assert hashed[8] is None
different_inds = [0, 1, 3, 4, 7]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
@pytest.mark.parametrize("seed", [1, 2, 42])
def test_hash_fixed_size_list_array_seeded_with_invalid(dtype, seed):
arr = Series.from_pylist([[1, 2], [1, 3], [1, 2], [1, 4], [5, 5], [5, 5], None, [2, 1], None]).cast(
DataType.fixed_size_list(dtype, 2)
)
seeds = Series.from_pylist([seed] * 9).cast(DataType.uint64())
hashed = arr.hash(seeds).to_pylist()
assert hashed[0] == hashed[2]
assert hashed[4] == hashed[5]
assert hashed[6] is None
assert hashed[8] is None
different_inds = [0, 1, 3, 4, 7]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
def test_hash_fixed_size_list_array_different_seeds(dtype):
arr = Series.from_pylist([[1, 2], [1, 2], [1, 2], [1, 2]]).cast(DataType.fixed_size_list(dtype, 2))
seeds = Series.from_pylist([1, 2, 3, 4]).cast(DataType.uint64())
hashed = arr.hash(seeds).to_pylist()
different_inds = [0, 1, 2, 3]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
def test_hash_fixed_size_list_array_consistency(dtype):
data = [[1, 2], [1, 3], [1, 2], [1, 4], [5, 5], [5, 5], None, [2, 1], None]
arr1 = Series.from_pylist(data).cast(DataType.fixed_size_list(dtype, 2))
arr2 = Series.from_pylist(data).cast(DataType.fixed_size_list(dtype, 2))
hashed1 = arr1.hash().to_pylist()
hashed2 = arr2.hash().to_pylist()
assert hashed1 == hashed2
@pytest.mark.parametrize("dtype", daft_numeric_types)
@pytest.mark.parametrize("seed", [None, 123])
def test_hash_struct(dtype, seed):
data = [
{"a": 1, "b": 2},
{"a": 3, "b": 4},
{"a": 1, "b": 4},
{"a": 2, "b": 1},
None,
{"b": 2, "a": 1},
{"b": 1, "a": 2},
None,
]
arr = Series.from_pylist(data).cast(DataType.struct({"a": dtype, "b": dtype}))
seeds = None if seed is None else Series.from_pylist([seed] * len(data)).cast(DataType.uint64())
hashed = arr.hash(seeds).to_pylist()
assert hashed[0] == hashed[5]
assert hashed[3] == hashed[6]
assert hashed[4] is None and hashed[-1] is None
different_inds = [0, 1, 2, 3]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
@pytest.mark.parametrize("seed", [None, 123])
def test_hash_struct_nested(dtype, seed):
data = [
{"a": 1, "b": {"c": 1, "d": 2}},
{"a": 3, "b": {"c": 3, "d": 4}},
{"a": 1, "b": {"c": 3, "d": 4}},
{"a": 2, "b": {"c": 1, "d": 2}},
None,
{"b": {"c": 1, "d": 2}, "a": 1},
{"b": {"c": 1, "d": 2}, "a": 2},
{"a": 1, "b": {"c": 2, "d": 1}},
None,
]
arr = Series.from_pylist(data).cast(DataType.struct({"a": dtype, "b": DataType.struct({"c": dtype, "d": dtype})}))
seeds = None if seed is None else Series.from_pylist([seed] * len(data)).cast(DataType.uint64())
hashed = arr.hash(seeds).to_pylist()
assert hashed[0] == hashed[5]
assert hashed[3] == hashed[6]
assert hashed[4] is None and hashed[-1] is None
different_inds = [0, 1, 2, 3, 7]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
@pytest.mark.parametrize("seed", [None, 123])
def test_hash_struct_sublist(dtype, seed):
data = [
{"a": 1, "b": [2, 3, 4]},
{"a": 3, "b": [5, 6, 7]},
{"a": 1, "b": [5, 6, 7]},
{"a": 2, "b": [2, 3, 4]},
None,
{"b": [2, 3, 4], "a": 1},
{"b": [2, 3, 4], "a": 2},
{"a": 1, "b": [2, 4, 3]},
None,
]
arr = Series.from_pylist(data).cast(DataType.struct({"a": dtype, "b": DataType.list(dtype)}))
seeds = None if seed is None else Series.from_pylist([seed] * len(data)).cast(DataType.uint64())
hashed = arr.hash(seeds).to_pylist()
assert hashed[0] == hashed[5]
assert hashed[3] == hashed[6]
assert hashed[4] is None and hashed[-1] is None
different_inds = [0, 1, 2, 3, 7]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize("dtype", daft_numeric_types)
@pytest.mark.parametrize("seed", [None, 123])
def test_hash_struct_with_nones(dtype, seed):
data = [
{"a": 1, "b": 2},
{"a": None, "b": 2},
{"a": 0, "b": 2},
{"a": None, "b": None},
{"a": 0, "b": 0},
None,
{"a": None, "b": 2},
None,
]
arr = Series.from_pylist(data).cast(DataType.struct({"a": dtype, "b": dtype}))
seeds = None if seed is None else Series.from_pylist([seed] * len(data)).cast(DataType.uint64())
hashed = arr.hash(seeds).to_pylist()
assert hashed[1] == hashed[6]
assert hashed[5] is None and hashed[-1] is None
different_inds = [0, 1, 2, 3, 4]
for i in range(len(different_inds)):
for j in range(i):
assert hashed[different_inds[i]] != hashed[different_inds[j]]
@pytest.mark.parametrize(
"dtype",
[
DataType.uint8(),
DataType.uint16(),
DataType.uint32(),
DataType.uint64(),
DataType.int8(),
DataType.int16(),
DataType.int32(),
DataType.int64(),
],
)
def test_murmur3_32_hash_int(dtype):
arr = Series.from_pylist([34, None]).cast(dtype)
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [2017239379, None]
@pytest.mark.parametrize(
"dtype",
[
DataType.int8(),
DataType.int16(),
DataType.int32(),
DataType.int64(),
],
)
def test_murmur3_32_hash_signed_int(dtype):
arr = Series.from_pylist([-1, 34, None]).cast(dtype)
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [1651860712, 2017239379, None]
def test_murmur3_32_hash_string():
arr = Series.from_pylist(["iceberg", None])
assert arr.datatype() == DataType.string()
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [1210000089, None]
def test_murmur3_32_hash_bytes():
arr = Series.from_pylist([b"\x00\x01\x02\x03", None])
assert arr.datatype() == DataType.binary()
hashes = arr.murmur3_32()
java_answer = -188683207
assert hashes.to_pylist() == [java_answer, None]
def test_murmur3_32_hash_fixed_sized_bytes():
import pyarrow as pa
arr = Series.from_arrow(pa.array([b"\x00\x01\x02\x03", None], type=pa.binary(4)))
assert arr.datatype() == DataType.fixed_size_binary(4)
hashes = arr.murmur3_32()
java_answer = -188683207
assert hashes.to_pylist() == [java_answer, None]
def test_murmur3_32_hash_date():
arr = Series.from_pylist([date(2017, 11, 16), None])
assert arr.datatype() == DataType.date()
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [-653330422, None]
def test_murmur3_32_hash_time():
arr = Series.from_pylist([time(22, 31, 8, 0), None])
assert arr.datatype() == DataType.time("us")
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [-662762989, None]
def test_murmur3_32_hash_time_nanoseconds():
arr = Series.from_pylist([time(22, 31, 8, 0), None])
arr = arr.cast(DataType.time("ns"))
assert arr.datatype() == DataType.time("ns")
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [-662762989, None]
def test_murmur3_32_hash_timestamp():
arr = Series.from_pylist([datetime(2017, 11, 16, 22, 31, 8), None])
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [-2047944441, None]
def test_murmur3_32_hash_timestamp_with_tz():
dt = datetime(2017, 11, 16, 14, 31, 8)
pst = pytz.timezone("US/Pacific")
dt = pst.localize(dt)
arr = Series.from_pylist([dt, None])
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [-2047944441, None]
def test_murmur3_32_hash_timestamp_with_tz_nanoseconds():
dt = datetime(2017, 11, 16, 14, 31, 8)
pst = pytz.timezone("US/Pacific")
dt = pst.localize(dt)
arr = Series.from_pylist([dt, None])
arr = arr.cast(DataType.timestamp("ns", "UTC"))
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [-2047944441, None]
def test_murmur3_32_hash_decimal_unscaled():
arr = Series.from_pylist([decimal.Decimal(1420), None])
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [-500754589, None]
def test_murmur3_32_hash_decimal_scaled():
arr = Series.from_pylist([decimal.Decimal("14.20"), None])
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [-500754589, None]
def test_murmur3_32_hash_decimal_full_scaled():
arr = Series.from_pylist([decimal.Decimal(".00001420"), None])
hashes = arr.murmur3_32()
assert hashes.to_pylist() == [-500754589, None]