From 58fa57c3d941cf4a1d28db6cc3be88b8c96be982 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 24 Oct 2024 17:45:54 -0500 Subject: [PATCH] cleanup --- bindings/python/pymongoarrow/lib.pyx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/bindings/python/pymongoarrow/lib.pyx b/bindings/python/pymongoarrow/lib.pyx index bd30f7ae..066f679f 100644 --- a/bindings/python/pymongoarrow/lib.pyx +++ b/bindings/python/pymongoarrow/lib.pyx @@ -196,10 +196,6 @@ cdef class BuilderManager: if parent_type == BSON_TYPE_ARRAY: (self.builder_map[base_key]).append_count() - # Update our count for top level documents. - if parent_type == 0: - self.count += 1 - cpdef void process_bson_stream(self, const uint8_t* bson_stream, size_t length): """Process a bson byte stream.""" cdef bson_reader_t* stream_reader = bson_reader_new_from_data(bson_stream, length) @@ -213,6 +209,7 @@ cdef class BuilderManager: if not bson_iter_init(&doc_iter, doc): raise InvalidBSON("Could not read BSON document") self.parse_document(&doc_iter, b"", 0) + self.count += 1 finally: bson_reader_destroy(stream_reader)