-
Notifications
You must be signed in to change notification settings - Fork 246
DRIVERS-3097 Update test cases for BSON Binary Vector #1750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,8 +44,15 @@ | |
| "vector": [127.0, 7.0], | ||
| "dtype_hex": "0x27", | ||
| "dtype_alias": "FLOAT32", | ||
| "padding": 3 | ||
| "padding": 3, | ||
| "canonical_bson": "1C00000005766563746F72000A0000000927030000FE420000E04000" | ||
| }, | ||
| { | ||
| "description": "Insufficient vector data FLOAT32", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like this test introduces a use case where drivers should validate for the absence of the array, as when a If that's the case, we should extend this test to cover INT8 and PackedBit, as well as other relevant fields which could be absent.I also think, explicitly defining
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The "canonical_bson" in "Insufficient vector data FLOAT32" is a corrupted BSON with insufficient bytes for 4-byte float32, so it lacks a corresponding float32 vector. It makes sense to use
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the clarification! At first glance, I thought the test was validating the absence of the entire vector array. There is a section outlining what drivers should do in both valid and invalid cases. In valid cases, Now that we have
Should we add another line for clarity? For example:
|
||
| "valid": false, | ||
| "dtype_hex": "0x27", | ||
| "dtype_alias": "FLOAT32", | ||
| "canonical_bson": "1700000005766563746F7200050000000927002A2A2A00" | ||
|
nbbeeken marked this conversation as resolved.
|
||
| } | ||
| ] | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,8 @@ | |
| "vector": [], | ||
| "dtype_hex": "0x10", | ||
| "dtype_alias": "PACKED_BIT", | ||
| "padding": 1 | ||
| "padding": 1, | ||
| "canonical_bson": "1400000005766563746F72000200000009100100" | ||
| }, | ||
| { | ||
| "description": "Simple Vector PACKED_BIT", | ||
|
|
@@ -61,21 +62,14 @@ | |
| "dtype_alias": "PACKED_BIT", | ||
| "padding": 0 | ||
| }, | ||
| { | ||
| "description": "Padding specified with no vector data PACKED_BIT", | ||
| "valid": false, | ||
| "vector": [], | ||
| "dtype_hex": "0x10", | ||
| "dtype_alias": "PACKED_BIT", | ||
| "padding": 1 | ||
| }, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was wrong with this test? An empty array but a non-zero padding?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a duplicate of L5-L12
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice spot! Thank you! |
||
| { | ||
| "description": "Exceeding maximum padding PACKED_BIT", | ||
| "valid": false, | ||
| "vector": [1], | ||
| "dtype_hex": "0x10", | ||
| "dtype_alias": "PACKED_BIT", | ||
| "padding": 8 | ||
| "padding": 8, | ||
| "canonical_bson": "1500000005766563746F7200030000000910080100" | ||
| }, | ||
| { | ||
| "description": "Negative padding PACKED_BIT", | ||
|
|
@@ -84,15 +78,6 @@ | |
| "dtype_hex": "0x10", | ||
| "dtype_alias": "PACKED_BIT", | ||
| "padding": -1 | ||
| }, | ||
| { | ||
| "description": "Vector with float values PACKED_BIT", | ||
| "valid": false, | ||
| "vector": [127.5], | ||
| "dtype_hex": "0x10", | ||
| "dtype_alias": "PACKED_BIT", | ||
| "padding": 0 | ||
| } | ||
| ] | ||
| } | ||
|
|
||
|
caseyclements marked this conversation as resolved.
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a section on validation in the specs that we should update too:
https://github.com/qingyang-hu/specifications/blob/drivers2926/source/bson-binary-vector/bson-binary-vector.md#validation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the
vectorfield is absent in an invalid case, iscanonical_bsonnow a required field?