Skip to content

Conversation

@sandraromanchenko
Copy link
Collaborator

@sandraromanchenko sandraromanchenko commented Jan 9, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 9, 2026 14:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds the truncate BSON tag to the CollStats struct fields to handle MongoDB returning floating-point values that need to be converted to int64 types, preventing unmarshaling errors when the MongoDB driver returns stats as floats.

Key changes:

  • Added truncate BSON tag to Count, Size, and AvgObjSize fields in the CollStats struct
  • Added unit test to verify float64-to-int64 truncation behavior
  • Added integration test with documents of varying sizes to ensure fractional avgObjSize values are handled correctly

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
topo/topo.go Added truncate BSON tag to CollStats struct fields to handle float64-to-int64 conversion
topo/topo_test.go Added unit test verifying float64 values are correctly truncated to int64 when unmarshaling
tests/test_collections_sharded.py Added integration test with varying document sizes to produce fractional avgObjSize values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sandraromanchenko sandraromanchenko merged commit b6f6ec6 into main Jan 14, 2026
57 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants