We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ae90e8 commit aae159fCopy full SHA for aae159f
bson/binary.py
@@ -491,7 +491,7 @@ def from_vector(
491
assert isinstance(dtype, BinaryVectorDtype)
492
metadata = struct.pack("<sB", dtype.value, padding)
493
494
- if isinstance(vector, np.ndarray):
+ if _NUMPY_AVAILABLE and isinstance(vector, np.ndarray):
495
data = _numpy_vector_to_bytes(vector, dtype)
496
else:
497
if dtype == BinaryVectorDtype.INT8: # pack ints in [-128, 127] as signed int8
0 commit comments