Repository navigation
Accept nested AbstractDict values in BSON - #156
Conversation
Reuse the existing dictionary constructor for nested AbstractDict values. Preserve dictionary iteration order and the specific BSON subdocument path. Add public regressions for assignment, constructors, arrays, recursive and empty values, snapshots, and native BSONTimestamp preservation. Both full minimum/current suites pass all 388 checks against MongoDB 5.0.33. AI disclosure: This work was prepared with assistance from OpenAI Codex.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #156 +/- ##
==========================================
+ Coverage 84.20% 84.56% +0.36%
==========================================
Files 11 11
Lines 1652 1652
==========================================
+ Hits 1391 1397 +6
+ Misses 261 255 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Release session and session-options handles in the existing test fixtures and verify cleared handles and repeated cleanup. This exercises teardown independently of garbage collection timing. AI disclosure: This work was prepared with assistance from OpenAI Codex.
|
Merged as The published API manual returns HTTP 200, includes the dictionary iteration-order contract, and has all 60 source links pointing to the merge commit. AI disclosure: This work was prepared with assistance from OpenAI Codex. |
Nested
OrderedDictand otherAbstractDictvalues raiseMethodErrorduring BSON construction, even though the standalone dictionary constructor accepts them. Broaden the shared nested-value setter to use that existing constructor. Encoded fields retain dictionary iteration order, and the more specific BSON subdocument method preserves native value types and snapshots.Add 22 permanent public checks for direct assignment, pair and outer-dictionary constructors, arrays, recursive nesting, empty dictionaries, substring keys, field order, snapshots, and native BSON timestamps. The tests use the standard library; this change adds no dependency or export. Existing session tests now release their native handles explicitly and verify safe repeated cleanup, so teardown coverage does not depend on garbage collection timing.
Validation:
OrderedCollections.OrderedDictcase,ImmutableDict, andDictgives 16 passes and ten errors before the fix, then 36 passes on each runtime. OrderedCollections 1.6.3 and 1.8.2 were used only in external test environments.Final head
8566d5apasses all 22 checks. Both ten-job workflows pass; all 18 coverage uploads were explicitly accepted for this repository and head, and all 18 reports are processed at 84.56% coverage. The existing coverage gates are unchanged. Merged asd77ad72b303cf9aac714162cffddbebfb0d95e40, with a tree identical to the tested head. All ten main-branch validation jobs pass; all nine expected reports are accepted and processed at 84.20%. The published API returns HTTP 200, documents dictionary iteration order, and has all 60 source links pointing to the merge commit.Fixes #111.
Co-authored by Codex
AI disclosure: This work was prepared with assistance from OpenAI Codex.