You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -419,7 +423,7 @@ cdef class StringBuilder(_ArrayBuilderBase):
419
423
value = bson_iter_utf8(doc_iter, &str_len)
420
424
returnself.builder.get().Append(value, str_len)
421
425
ifnotself.allow_invalid and value_t != BSON_TYPE_NULL:
422
-
raiseTypeError(f"Got unexpected type `{_get_human_readable_bson_type_t(value_t)}` instead of expected type `{_get_human_readable_bson_type_t(self.type_marker)}`")
426
+
raiseTypeError(f"Got unexpected type `{_bson_type_name(<uint8_t>value_t)}` instead of expected type `{_bson_type_name(self.type_marker)}`")
423
427
else:
424
428
returnself.builder.get().AppendNull()
425
429
@@ -441,7 +445,7 @@ cdef class CodeBuilder(StringBuilder):
ifnotself.allow_invalid and value_t != BSON_TYPE_NULL:
444
-
raiseTypeError(f"Got unexpected type `{_get_human_readable_bson_type_t(value_t)}` instead of expected type `{_get_human_readable_bson_type_t(self.type_marker)}`")
448
+
raiseTypeError(f"Got unexpected type `{_bson_type_name(<uint8_t>value_t)}` instead of expected type `{_bson_type_name(self.type_marker)}`")
445
449
else:
446
450
returnself.builder.get().AppendNull()
447
451
@@ -466,7 +470,7 @@ cdef class ObjectIdBuilder(_ArrayBuilderBase):
ifnotself.allow_invalid and value_t != BSON_TYPE_NULL:
469
-
raiseTypeError(f"Got unexpected type `{_get_human_readable_bson_type_t(value_t)}` instead of expected type `{_get_human_readable_bson_type_t(self.type_marker)}`")
473
+
raiseTypeError(f"Got unexpected type `{_bson_type_name(<uint8_t>value_t)}` instead of expected type `{_bson_type_name(self.type_marker)}`")
470
474
else:
471
475
returnself.builder.get().AppendNull()
472
476
@@ -507,7 +511,7 @@ cdef class Int32Builder(_ArrayBuilderBase):
507
511
raiseOverflowError("Overflowed Int32 value")
508
512
returnself.builder.get().Append(ivalue)
509
513
ifnotself.allow_invalid and value_t != BSON_TYPE_NULL:
510
-
raiseTypeError(f"Got unexpected type `{_get_human_readable_bson_type_t(value_t)}` instead of expected type `{_get_human_readable_bson_type_t(self.type_marker)}`")
514
+
raiseTypeError(f"Got unexpected type `{_bson_type_name(<uint8_t>value_t)}` instead of expected type `{_bson_type_name(self.type_marker)}`")
511
515
else:
512
516
returnself.builder.get().AppendNull()
513
517
@@ -538,7 +542,7 @@ cdef class Int64Builder(_ArrayBuilderBase):
ifnotself.allow_invalid and value_t != BSON_TYPE_NULL:
541
-
raiseTypeError(f"Got unexpected type `{_get_human_readable_bson_type_t(value_t)}` instead of expected type `{_get_human_readable_bson_type_t(self.type_marker)}`")
545
+
raiseTypeError(f"Got unexpected type `{_bson_type_name(<uint8_t>value_t)}` instead of expected type `{_bson_type_name(self.type_marker)}`")
542
546
else:
543
547
returnself.builder.get().AppendNull()
544
548
@@ -562,7 +566,7 @@ cdef class DoubleBuilder(_ArrayBuilderBase):
ifnotself.allow_invalid and value_t != BSON_TYPE_NULL:
565
-
raiseTypeError(f"Got unexpected type `{_get_human_readable_bson_type_t(value_t)}` instead of expected type `{_get_human_readable_bson_type_t(self.type_marker)}`")
569
+
raiseTypeError(f"Got unexpected type `{_bson_type_name(<uint8_t>value_t)}` instead of expected type `{_bson_type_name(self.type_marker)}`")
566
570
else:
567
571
returnself.builder.get().AppendNull()
568
572
@@ -596,7 +600,7 @@ cdef class DatetimeBuilder(_ArrayBuilderBase):
ifnotself.allow_invalid and value_t != BSON_TYPE_NULL:
599
-
raiseTypeError(f"Got unexpected type `{_get_human_readable_bson_type_t(value_t)}` instead of expected type `{_get_human_readable_bson_type_t(self.type_marker)}`")
603
+
raiseTypeError(f"Got unexpected type `{_bson_type_name(<uint8_t>value_t)}` instead of expected type `{_bson_type_name(self.type_marker)}`")
600
604
else:
601
605
returnself.builder.get().AppendNull()
602
606
@@ -618,7 +622,7 @@ cdef class Date64Builder(_ArrayBuilderBase):
ifnotself.allow_invalid and value_t != BSON_TYPE_NULL:
693
-
raiseTypeError(f"Got unexpected type `{_get_human_readable_bson_type_t(value_t)}` instead of expected type `{_get_human_readable_bson_type_t(self.type_marker)}`")
697
+
raiseTypeError(f"Got unexpected type `{_bson_type_name(<uint8_t>value_t)}` instead of expected type `{_bson_type_name(self.type_marker)}`")
694
698
else:
695
699
returnself.builder.get().AppendNull()
696
700
@@ -718,15 +722,15 @@ cdef class Decimal128Builder(_ArrayBuilderBase):
718
722
719
723
ifself.supported ==0:
720
724
# We do not support big-endian systems.
721
-
raiseTypeError(f"Big-endian systems are not supported for `{_get_human_readable_bson_type_t(self.type_marker)}`")
725
+
raiseTypeError(f"Big-endian systems are not supported for `{_bson_type_name(self.type_marker)}`")
722
726
723
727
if value_t == BSON_TYPE_DECIMAL128:
724
728
bson_iter_decimal128(doc_iter, &dec128)
725
729
memcpy(dec128_buf, &dec128.low, 8);
726
730
memcpy(dec128_buf +8, &dec128.high, 8)
727
731
returnself.builder.get().Append(dec128_buf)
728
732
ifnotself.allow_invalid and value_t != BSON_TYPE_NULL:
729
-
raiseTypeError(f"Got unexpected type `{_get_human_readable_bson_type_t(value_t)}` instead of expected type `{_get_human_readable_bson_type_t(self.type_marker)}`")
733
+
raiseTypeError(f"Got unexpected type `{_bson_type_name(<uint8_t>value_t)}` instead of expected type `{_bson_type_name(self.type_marker)}`")
730
734
else:
731
735
returnself.builder.get().AppendNull()
732
736
@@ -768,7 +772,7 @@ cdef class BinaryBuilder(_ArrayBuilderBase):
ifnotself.allow_invalid and value_t != BSON_TYPE_NULL:
771
-
raiseTypeError(f"Got unexpected type `{_get_human_readable_bson_type_t(value_t)}` instead of expected type `{_get_human_readable_bson_type_t(self.type_marker)}`")
775
+
raiseTypeError(f"Got unexpected type `{_bson_type_name(<uint8_t>value_t)}` instead of expected type `{_bson_type_name(self.type_marker)}`")
0 commit comments