File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -739,7 +739,7 @@ def test_vector(self):
739
739
"""Tests of subtype 9"""
740
740
# We start with valid cases, across the 3 dtypes implemented.
741
741
# Work with a simple vector that can be interpreted as int8, float32, or ubyte
742
- list_vector = [127 , 7 ]
742
+ list_vector = [127 , 8 ]
743
743
# As INT8, vector has length 2
744
744
binary_vector = Binary .from_vector (list_vector , BinaryVectorDtype .INT8 )
745
745
vector = binary_vector .as_vector ()
@@ -764,18 +764,18 @@ def test_vector(self):
764
764
uncompressed = ""
765
765
for val in list_vector :
766
766
uncompressed += format (val , "08b" )
767
- assert uncompressed [:- padding ] == "0111111100000 "
767
+ assert uncompressed [:- padding ] == "0111111100001 "
768
768
769
769
# It is worthwhile explicitly showing the values encoded to BSON
770
770
padded_doc = {"padded_vec" : padded_vec }
771
771
assert (
772
772
encode (padded_doc )
773
- == b"\x1a \x00 \x00 \x00 \x05 padded_vec\x00 \x04 \x00 \x00 \x00 \t \x10 \x03 \x7f \x07 \x00 "
773
+ == b"\x1a \x00 \x00 \x00 \x05 padded_vec\x00 \x04 \x00 \x00 \x00 \t \x10 \x03 \x7f \x08 \x00 "
774
774
)
775
775
# and dumped to json
776
776
assert (
777
777
json_util .dumps (padded_doc )
778
- == '{"padded_vec": {"$binary": {"base64": "EAN/Bw ==", "subType": "09"}}}'
778
+ == '{"padded_vec": {"$binary": {"base64": "EAN/CA ==", "subType": "09"}}}'
779
779
)
780
780
781
781
# FLOAT32 is also implemented
You can’t perform that action at this time.
0 commit comments